This quickstart uses Universal Auth. For the full list of authentication methods and when to pick each one, see Authentication.
Prerequisites
- The Admin role on either your Infisical organization or a project in the organization
Step 1: Create a machine identity
You can create a machine identity at the organization level or scoped to a single project. The rest of the quickstart works the same either way.- Organization-level
- Project-level
1
In your organization, go to Access Control > Machine Identities, then select Create.
2
Enter a Name for the identity, pick an organization Role (Admin or Member are both fine for this guide), and select Create.
Step 2: Generate a client secret
Universal Auth uses a Client ID and Client Secret pair. Infisical creates the Client ID with the identity but issues each Client Secret on demand.1
On the identity’s details page, in the Authentication card, select the Universal Auth row.
2
In the sheet that opens, copy the Client ID.
3
Select Add Client Secret, then Create to generate a new secret.
Step 3: Exchange the credentials for an access token
Call the login endpoint for Universal Auth with the Client ID and Client Secret in the request body:expiresIn), and the maximum lifetime the token can reach with renewals (accessTokenMaxTTL):
Step 4: Call the API with the access token
Include the access token as anAuthorization: Bearer header on every request. For example, to look up the identity’s own details:
Authorization header format.
You can now make authenticated calls to the Infisical API.
Next steps
To call an endpoint that operates on a project’s resources (for example, reading secrets, issuing certificates, or managing PAM resources), the identity needs to be a member of that project. If you create the machine identity at the organization-level, it needs to be added to each project you want it to reach. You can do this from Access Control > Machine Identities inside the project itself. For more information, check out the machine identity docs:Machine identities
How machine identities work, including scopes, project membership, roles, credential rotation, and alerts.