Exchange OAuth grant
Exchanges an OAuth2 grant (e.g.: authorization code) for an access token (and optionally a refresh/id token) - for a detailed description of all input parameters please see the OAuth2 and OpenID Connect Core specs
POST
/{apiBasePath}/oauth/tokenPath parameters
apiBasePathstringrequiredIts value depends on the apiBasePath set by the user
Responses
200Issued tokens
One of:
object
access_tokenstringThe access token issued by the authorization server.
expires_innumberrequiredThe lifetime in seconds of the access token (integer). For example, the value "3600" denotes that the access token will expire in one hour from the time the response was generated.
id_tokenstringTo retrieve a refresh token request the id_token scope.
refresh_tokenstringThe refresh token, which can be used to obtain new access tokens. To retrieve it add the scope "offline" to your access token request.
scopestringrequiredThe scope of the access token
token_typestringrequiredThe type of the token issued
generalErrorResponse
statusstringError status code
Allowed:
GENERAL_ERRORmessagestringError message
400OAuth2 specific error response
errorstringThe OAuth2 error code
error_descriptionstringHuman readable error description
404Resource not found error
string500Internal server error
stringTry it
Server
Parameters
Request
curl -X POST "/auth/oauth/token"const response = await fetch("/auth/oauth/token", {
method: "POST"
});import requests
response = requests.post(
"/auth/oauth/token",
)Response
{
"access_token": "string",
"expires_in": 0,
"id_token": "string",
"refresh_token": "string",
"scope": "string",
"token_type": "string"
}{
"error": "invalid_request",
"error_description": "Unsupported grant type: password"
}"Not Found""Internal Error"