Supported OData Authorization request formats:
Authorization Code Request
The data service must accept the token request as URL encoded.
The data service must accept an Authorization header with the client ID and client secret encoded as a base 64 string.
The data service must accept as a body parameter grant_type: authorization_code.
Scopes are optional, but if supported, the data service must accept them as a body parameter scope: <SCOPE1 SCOPE2 SCOPE3...>. The scopes are sent as a string.
Example:
curl -X POST \
<Token URL> \
-H 'Accept: */*' \
-H 'Authorization: Basic <BASE 64 Encoded String>' \
-d grant_type=authorization_grant
-d code=<Authorization code>
-d redirect_uri=<Redirect URI>
The response must be of content type JSON, and include in the response body the following parameters as top level JSON objects: access_token, refresh_token, and token_type. It may contain other parameters.
Example:
{
"access_token": "<ACCESS TOKEN>",
"refresh_token": <REFRESH TOKEN>",
"token_type": "Bearer",
"expires_in": 0,
"scope": ""
}
Note that if the required parameters are returned in arrays or as nested parameters, they may not be processed correctly.
Incorrect Example:
{
"authorization"
{
"access_token": "<ACCESS TOKEN>",
"refresh_token": <REFRESH TOKEN>",
"token_type": "Bearer",
"expires_in": 0,
"scope": ""
}
}
Client Credentials
The data service must accept the token request as URL encoded.
The data service must accept an Authorization header with the client ID and client secret encoded as a base 64 string.
The data service must accept as a body parameter grant_type: client_credentials.
Scopes are optional, but if supported, the data service must accept them as a body parameter scope: <SCOPE1 SCOPE2 SCOPE3...>. The scopes are sent as a string.
Example:
curl -X POST \
<Token URL> \
-H 'Accept: */*' \
-H 'Authorization: Basic <BASE 64 Encoded String>' \
-d grant_type=client_credentials
The response must be of content type JSON, and include in the response body the following parameters as top level JSON objects: access_token, and token_type. It may contain other parameters.
Example:
{
"access_token": "<ACCESS TOKEN>",
"token_type": "Bearer",
"expires_in": 0,
"scope": ""
}
Note that if the required parameters are returned in arrays or as nested parameters, they may not be processed correctly.
Incorrect Example:
{
"authorization"
{
"access_token": "<ACCESS TOKEN>",
"token_type": "Bearer",
"expires_in": 0,
"scope": ""
}
}
Basic
The data service must accept an Authorization header with the user name and password encoded as a base 64 string.