|
TokenIssueAction | Action [get, set] |
| The next action that the token endpoint implementation should take. More...
|
|
string | ResponseContent [get, set] |
| The response content which can be used as the entity body of the response to the client application. More...
|
|
string | AccessToken [get, set] |
| The newly issued access token. This property returns a non-null value only when the Action property returns TokenIssueAction.OK . More...
|
|
long | AccessTokenExpiresAt [get, set] |
| The date at which the access token will expire. The value is expressed in milliseconds since the Unix epoch (1970-Jan-1). More...
|
|
long | AccessTokenDuration [get, set] |
| The duration of the access token in seconds. More...
|
|
string | RefreshToken [get, set] |
| The newly issued refresh token. This property returns a non-null value only when the Action property returns TokenIssueAction.OK and the service is configured to support the refresh token flow. More...
|
|
long | RefreshTokenExpiresAt [get, set] |
| The date at which the refresh token will expire. The value is expressed in milliseconds since the Unix epoch (1970-Jan-1). More...
|
|
long | RefreshTokenDuration [get, set] |
| The duration of the refresh token in seconds. More...
|
|
long | ClientId [get, set] |
| The ID of the client application associated with the access token. More...
|
|
string | ClientIdAlias [get, set] |
| The client ID alias. If no alias is assigned to the client application, this property returns null . More...
|
|
bool | IsClientIdAliasUsed [get, set] |
| The flag which indicates whether the client ID alias was used when the token request was made. More...
|
|
string | Subject [get, set] |
| The subject (= unique identifier) of the user (= resource owner) of the access token. More...
|
|
string[] | Scopes [get, set] |
| The scopes covered by the access token. More...
|
|
Property[] | Properties [get, set] |
| Extra properties associated with the access token. More...
|
|
string | JwtAccessToken [get, set] |
| The newly issued access token in JWT format. More...
|
|
string[] | AccessTokenResources [get, set] |
| The target resources of the 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/issue
API.
Authlete's /api/auth/token/issue
API returns JSON which can be mapped to this class. The token endpoint implementation should retrieve the value of the "action"
response parameter (which can be obtained via the Action
property of this class) from the response and take the following steps according to the value.
When the value of the Action
property is TokenIssueAction.INTERNAL_SERVER_ERROR
, it means that the request from your system was wrong or that an error occurred in Authlete. In either case, from a viewpoint of the client application, it is an error on the server side. Therefore, the token endpoint implementation should generate a response to the client application with the HTTP status of "500 Internal Server Error"
.
In this case, the ResponseContent
property returns a JSON string which describes the error, so it can be used as the entity body of the response. The following illustrates the response which the token endpoint implementation should generate and return to the client application.
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
When the value of the Action
property is TokenIssueAction.OK
, it means that Authlete's /api/auth/token/issue
API successfully generated an access token. The HTTP status of the response returned to the client application must be "200 OK"
and the content type must be "application/json"
.
In this case, the ResponseContent
property returns a JSON string which contains the issued access token, so it can be used as the entity body of the response. The following illustrates the response which the token endpoint implementation should generate and return to the client application.
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache