Authlete
TokenFailResponse Class Reference

Response from Authlete's /api/auth/token/fail API. More...

Inheritance diagram for TokenFailResponse:
ApiResponse

Properties

TokenFailAction 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 returned to the client application. More...
 
- Properties inherited from ApiResponse
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...
 

Detailed Description

Response from Authlete's /api/auth/token/fail API.

Authlete's /api/auth/token/fail API returns JSON which can be mapped to this class. The authorization server implementation should retrieve the value of the "action" parameter (which can be obtained via the Action property of this class) from the response and the take the following steps according to the value.

When the value of the Action property is TokenFailAction.INTERNAL_SERVER_ERROR, it means that the request from the authorization server (AuthorizationFailRequest) 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 authorization server 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 authorization server 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
(The value returned from ResponseContent)

When the value of the Action property is TokenFailAction.BAD_REQUEST, it means that Authlete's /api/auth/token/fail API successfully generated an error response for the client application. The HTTP status of the response returned to the client application must be "400 Bad Request" and the content type must be "application/json".

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 authorization server implementation should generate and return to the client application.

HTTP/1.1 400 Bad Request
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
(The value returned from ResponseContent)

Property Documentation

◆ Action

TokenFailAction Action
getset

The next action that the token endpoint implementation should take.

◆ ResponseContent

string ResponseContent
getset

The response content which can be used as the entity body of the response returned to the client application.


The documentation for this class was generated from the following file:
Authlete.Dto.TokenFailResponse.ResponseContent
string ResponseContent
The response content which can be used as the entity body of the response returned to the client appl...
Definition: TokenFailResponse.cs:112