OAuth Token Exchange
The OAuth Token Exchange API allows you to exchange external identity tokens (like those from OIDC providers) for Pulumi access tokens. This enables automated workflows to authenticate with Pulumi Cloud without storing long-lived credentials.
Token
POST
/api/oauth/tokenExchanges an external identity provider token for a Pulumi access token using the OAuth 2.0 Token Exchange flow (RFC 8693).
The request body must include:
audience: a URN identifying the target org (e.g.,urn:pulumi:org:{ORG_NAME})grant_type: must beurn:ietf:params:oauth:grant-type:token-exchangesubject_token: the OIDC identity token from the external providersubject_token_type: must beurn:ietf:params:oauth:token-type:id_tokenrequested_token_type: one ofurn:pulumi:token-type:access_token:organization,...team,...personal, or...runner
Optional parameters:
scope: depends on the requested token type. Fororganization, must be empty oradmin. Forteam, must beteam:TEAM_NAME. Forpersonal, must beuser:USER_LOGIN. Forrunner, must berunner:RUNNER_NAME.expiration: token lifetime in seconds
The response includes access_token, issued_token_type, token_type, expires_in, scope, and refresh_token.
Request Body
Responses
200
OK
Schema: TokenExchangeGrantResponse
access_tokenstring requiredThe security token issued by the authorization server.issued_token_typestring requiredThe type of the issued token.token_typestring requiredThe token type (e.g., Bearer).expires_ininteger requiredThe lifetime in seconds of the access token.scopestring requiredThe scope of the access token.refresh_tokenstring optionalThe refresh token, if issued.
Thank you for your feedback!
If you have a question about how to use Pulumi, reach out in Community Slack.
Open an issue on GitHub to report a problem or suggest an improvement.