Learn how to authenticate Github workflows with Infisical using OpenID Connect (OIDC).
/api/v1/auth/oidc-auth/login
endpoint. If successful,
then Infisical returns a short-lived access token that can be used to make authenticated requests to the Infisical API.
To be more specific:
/api/v1/auth/oidc-auth/login
endpoint.Creating an identity
https://token.actions.githubusercontent.com
https://token.actions.githubusercontent.com
"repo:<owner>/<repo>:<environment>"
. The environment can be where the GitHub workflow is running, such as environment
, ref
, or job_workflow_ref
. For example, if you have a repository owned by octocat named example-repo, and the GitHub workflow is running on the main branch, the subject field might look like this: repo:octocat/example-repo:ref:refs/heads/main
https://github.com/octo-org
).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.
subject
, audiences
, and claims
fields support glob pattern matching; however, we highly recommend using hardcoded values whenever possible.Adding an identity to a project
Accessing the Infisical API with the identity
id-token:write
permissions for the Github workflow. This setting allows the JWT to be requested from Github’s OIDC provider./api/v1/auth/oidc-auth/login
endpoint in exchange for an access token.
The identity token can be fetched using either of the following approaches:ACTIONS_ID_TOKEN_REQUEST_URL
and ACTIONS_ID_TOKEN_REQUEST_TOKEN
).getIDToken()
from the Github Actions toolkit.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.