|
TokenCreateAction | Action [get, set] |
| The code which indicates how the response from Authlete's /api/auth/token/create API should be interpreted. More...
|
|
GrantType | GrantType [get, set] |
| The grant type emulated for the newly issued access token. More...
|
|
long | ClientId [get, set] |
| The client ID associated with the newly issued access token. More...
|
|
string | Subject [get, set] |
| The subject (= unique identifier) of the user associated with the newly issued access token. This property is null when the grant type is GrantType.CLIENT_CREDENTIALS . More...
|
|
string[] | Scopes [get, set] |
| The scopes associated with the newly issued access token. More...
|
|
string | AccessToken [get, set] |
| The value of the newly issued access token. More...
|
|
string | TokenType [get, set] |
| The token type of the newly issued access token. For example, "Bearer" . More...
|
|
long | ExpiresIn [get, set] |
| The duration of the newly issued access token in seconds. More...
|
|
long | ExpiresAt [get, set] |
| The date at which the newly issued access token will expire. The value is expressed in milliseconds since the Unix epoch (1970-Jan-1). More...
|
|
string | RefreshToken [get, set] |
| The value of the newly issued refresh token. This property is null when the grant type is either GrantType.IMPLICIT or GrantType.CLIENT_CREDENTIALS . More...
|
|
Property[] | Properties [get, set] |
| The properties associated with the newly issued access token. More...
|
|
string | ResultCode [get, set] |
| The code of the result of an Authlete API call. For example, "A004001" . More...
|
|
string | ResultMessage [get, set] |
| The message of the result of an Authlete API call. For example, "[A001202] /client/get/list,
Authorization header is missing." More...
|
|
Response from Authlete's /api/auth/token/create
API.
Authlete's /api/auth/token/create
API returns JSON which can be mapped to this class. The first step that a caller should take is to retrieve the value of the "action"
response parameter (which can be obtained via the Action
property of this class) from the response.
When the value of the Action
property is TokenCreateAction.INTERNAL_SERVER_ERROR
, it means that an error occurred on Authlete side.
When the value of the Action
property is TokenCreateAction.BAD_REQUEST
, it means that the request from the caller was wrong. For example, this happens when the "grantType"
request parameter is missing.
When the value of the Action
property is TokenCreateAction.FORBIDDEN
, it means that the request from the caller is not allowed. For example, this happens when the client application identified by the "clientId"
request parameter does not belong to the service identified by the API key used for the API call.
When the value of the Action
property is TokenCreateAction.OK
, it means that everything was processed successfully and an access token and optionally a refresh token were issued. So, in short, when the value of the Action
property is TokenCreateAction.OK
, you can retrieve the values of a new access token and an optional refresh token from the AccessToken
property and the RefreshToken
property.