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 a presented credential for a Pulumi access token. Two grant types are supported, selected by the grant_type field in the request body.
Token exchange (RFC 8693). Exchanges an external OIDC identity provider token for a Pulumi access token. Request body:
grant_type: must beurn:ietf:params:oauth:grant-type:token-exchangeaudience: a URN identifying the target org (e.g.,urn:pulumi:org:{ORG_NAME})subject_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...runnerscope(optional): 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(optional): token lifetime in seconds.
Refresh token (RFC 6749 §6). Exchanges a Pulumi-issued refresh token for a short-lived on-behalf-of access token bound to the user the refresh token resolves to. Request body:
grant_type: must berefresh_tokenrefresh_token: the refresh-token value previously issued by Pulumi.
Both grants return the same response shape: 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.