The token endpoint is used to get the user's access token, id token and refresh token.
This document explains how to call the token endpoint and what are the parameters supported by Identity Authentication.
URI:https://<Cloud Identity Services domain>/oauth2/token
The domain part has the following pattern:
<tenant ID>.accounts.ondemand.com
or<tenant ID>.accounts.cloud.sap
. If you have a configured custom domain, the domain has the following pattern: <your custom domain>.Tenant ID is an automatically generated ID by the system. The first administrator created for the tenant receives an activation email with a URL in it. This URL contains the tenant ID. For more information about your tenants, see View Assigned Tenants and Admins.
**HTTP Method:**POST
Header |
Required |
Values |
---|---|---|
|
Yes |
application/x-www-form-urlencoded |
|
Yes |
|
Parameter |
Required |
Data Type |
Description |
Parameter Type |
---|---|---|---|---|
|
Yes |
string |
authorization_code |
Request body |
|
Yes |
string |
The
|
Request body |
|
Yes |
string |
The same URL that has been sent with the authorization request. For more information, see Configure OpenID Connect Application. |
Request body |
|
Yes |
string |
The user ID configured for basic authentication for the application. For more information, see Configure Secrets for API Authentication. |
Request body |
|
No |
string |
Validation value for the |
Request body |
|
No |
string |
Reduces the expiry of a refresh token. It is useful if your application is called from mobile and web applications, and both have different session requirements. If you set the token lifetime to 0 or less, you won't receive a |
Request body |
|
No |
string |
The |
Request body |
|
No |
string |
Reserved. |
Path |
grant_type=authorization_code&client_id=12b52d2c-1q34-5r5t-a576-75e85asdf523&code=768fsd1206we951236729134fa4a247ee&redirect_uri=https://www.example.com
grant_type=authorization_code&client_id=23q45d2c-1e98-4c7f-a576-69e85dddb456&code=b1d87f103c9f4c8a936a2f164c8728a0&redirect_uri=https://www.example.com&code_verifier=e4yAeaa_OLJ-8ZC1sj6JWFqgRK8QR-egfqG4lQlsy0~NOrjOcVdIpPxPvUEsG1Il1LP76F0MGr4a0miVD2Z84Gn_Lw67BhZ9GQDTF6wN_fUwQtJJeN3bnvk7J.Ty6jDi
Code |
Reason |
Description |
---|---|---|
200 OK |
Successful operation. |
Returns
|
400 Bad Request |
Missing or wrong parameter. |
Returns information about the error. |
{
"access_token":
"eyJ0eXAiOiJKV1QiLCJh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PB2gyu3NdTbINDJ9eRs997g",
"token_type": "Bearer",
"expires_in": 3600
}
The format of the
issuer
depends on the configuration in the administration console for SAP Cloud Identity Services. For more information, see Tenant OpenID Connect Configurations.
Related Information