ExchangeToken
identity.exchange_token(IdentityExchangeTokenParams**kwargs) -> IdentityExchangeTokenResponse
POST/gitpod.v1.IdentityService/ExchangeToken
Exchanges an exchange token for a new access token.
Use this method to:
- Convert exchange tokens to access tokens
- Obtain new access credentials
- Complete token exchange flows
Examples
-
Exchange token:
Trades an exchange token for an access token.
exchangeToken: "exchange-token-value"
ExchangeToken
import os
from gitpod import Gitpod
client = Gitpod(
bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted
)
response = client.identity.exchange_token(
exchange_token="exchange-token-value",
)
print(response.access_token){
"accessToken": "accessToken"
}Returns Examples
{
"accessToken": "accessToken"
}