Learn how to authenticate to Infisical from any platform or environment.
Universal Auth is the most versatile authentication method that can be configured for a machine identity to access Infisical from any platform or environment.
In this method, each identity is given a Client ID for which you can generate one or more Client Secret(s). Together, a Client ID and Client Secret can be exchanged for an access token to authenticate with the Infisical API.
Universal Auth supports many settings that can be beneficial for tightening your workflow security configuration:
In the following steps, we explore how to create and use identities for your workloads and applications to access the Infisical API using the Universal Auth authentication method.
Creating an identity
To create an identity, head to your Organization Settings > Access Control > Machine Identities and press Create identity.
When creating an identity, you specify an organization level role for it to assume; you can configure roles in Organization Settings > Access Control > Organization Roles.
Now input a few details for your new identity. Here’s some guidance for each field:
Once you’ve created an identity, you’ll be prompted to configure the Universal Auth authentication method for it.
Here’s some more guidance on each field:
2592000
equivalent to 30 days): The lifetime for an acccess token in seconds. This value will be referenced at renewal time.2592000
equivalent to 30 days): The maximum lifetime for an acccess token in seconds. This value will be referenced at renewal time.0
): The maximum number of times that an access token can be used; a value of 0
implies infinite number of uses.0.0.0.0/0
, allowing usage from any network address.0.0.0.0/0
, allowing usage from any network address.Restricting Client Secret and access token usage to specific trusted IPs is a paid feature.
If you’re using Infisical Cloud, then it is available under the Pro Tier. If you’re self-hosting Infisical, then you should contact sales@infisical.com to purchase an enterprise license to use it.
Creating a Client Secret
In order to use the identity, you’ll need the non-sensitive Client ID of the identity and a Client Secret for it; you can think of these credentials akin to a username and password used to authenticate with the Infisical API. With that, press on the key icon on the identity to generate a Client Secret for it.
Feel free to input any (optional) details for the Client Secret configuration:
0
): The time-to-live for the Client Secret. By default, the TTL will be set to 0 which implies that the Client Secret will never expire; a value of 0
implies an infinite lifetime.0
): The maximum number of times that the Client Secret can be used together with the Client ID to get back an access token; a value of 0
implies infinite number of uses.Adding an identity to a project
To enable the identity to access project-level resources such as secrets within a specific project, you should add it to that project.
To do this, head over to the project you want to add the identity to and go to Project Settings > Access Control > Machine Identities and press Add identity.
Next, select the identity you want to add to the project and the project level role you want to allow it to assume. The project role assigned will determine what project level resources this identity can have access to.
Accessing the Infisical API with the identity
To access the Infisical API as the identity, you should first perform a login operation
that is to exchange the Client ID and Client Secret of the identity for an access token
by making a request to the /api/v1/auth/universal-auth/login
endpoint.
Next, you can use the access token to authenticate with the Infisical API
Each identity access token has a time-to-live (TLL) which you can infer from the response of the login operation;
the default TTL is 7200
seconds which can be adjusted.
If an identity access token expires, it can no longer authenticate with the Infisical API. In this case, a new access token should be obtained by performing another login operation.
FAQ
Learn how to authenticate to Infisical from any platform or environment.
Universal Auth is the most versatile authentication method that can be configured for a machine identity to access Infisical from any platform or environment.
In this method, each identity is given a Client ID for which you can generate one or more Client Secret(s). Together, a Client ID and Client Secret can be exchanged for an access token to authenticate with the Infisical API.
Universal Auth supports many settings that can be beneficial for tightening your workflow security configuration:
In the following steps, we explore how to create and use identities for your workloads and applications to access the Infisical API using the Universal Auth authentication method.
Creating an identity
To create an identity, head to your Organization Settings > Access Control > Machine Identities and press Create identity.
When creating an identity, you specify an organization level role for it to assume; you can configure roles in Organization Settings > Access Control > Organization Roles.
Now input a few details for your new identity. Here’s some guidance for each field:
Once you’ve created an identity, you’ll be prompted to configure the Universal Auth authentication method for it.
Here’s some more guidance on each field:
2592000
equivalent to 30 days): The lifetime for an acccess token in seconds. This value will be referenced at renewal time.2592000
equivalent to 30 days): The maximum lifetime for an acccess token in seconds. This value will be referenced at renewal time.0
): The maximum number of times that an access token can be used; a value of 0
implies infinite number of uses.0.0.0.0/0
, allowing usage from any network address.0.0.0.0/0
, allowing usage from any network address.Restricting Client Secret and access token usage to specific trusted IPs is a paid feature.
If you’re using Infisical Cloud, then it is available under the Pro Tier. If you’re self-hosting Infisical, then you should contact sales@infisical.com to purchase an enterprise license to use it.
Creating a Client Secret
In order to use the identity, you’ll need the non-sensitive Client ID of the identity and a Client Secret for it; you can think of these credentials akin to a username and password used to authenticate with the Infisical API. With that, press on the key icon on the identity to generate a Client Secret for it.
Feel free to input any (optional) details for the Client Secret configuration:
0
): The time-to-live for the Client Secret. By default, the TTL will be set to 0 which implies that the Client Secret will never expire; a value of 0
implies an infinite lifetime.0
): The maximum number of times that the Client Secret can be used together with the Client ID to get back an access token; a value of 0
implies infinite number of uses.Adding an identity to a project
To enable the identity to access project-level resources such as secrets within a specific project, you should add it to that project.
To do this, head over to the project you want to add the identity to and go to Project Settings > Access Control > Machine Identities and press Add identity.
Next, select the identity you want to add to the project and the project level role you want to allow it to assume. The project role assigned will determine what project level resources this identity can have access to.
Accessing the Infisical API with the identity
To access the Infisical API as the identity, you should first perform a login operation
that is to exchange the Client ID and Client Secret of the identity for an access token
by making a request to the /api/v1/auth/universal-auth/login
endpoint.
Next, you can use the access token to authenticate with the Infisical API
Each identity access token has a time-to-live (TLL) which you can infer from the response of the login operation;
the default TTL is 7200
seconds which can be adjusted.
If an identity access token expires, it can no longer authenticate with the Infisical API. In this case, a new access token should be obtained by performing another login operation.
FAQ