Class TokenFailResponse

  • All Implemented Interfaces:
    Serializable

    public class TokenFailResponse
    extends ApiResponse
    Response from Authlete's /auth/token/fail API.

    Authlete's /auth/token/fail API returns JSON which can be mapped to this class. The service implementation should retrieve the value of "action" from the response and take the following steps according to the value.

    INTERNAL_SERVER_ERROR

    When the value of "action" is "INTERNAL_SERVER_ERROR", it means that the request from the service implementation (AuthorizationFailRequest) was wrong or that an error occurred in Authlete.

    In either case, from the viewpoint of the client application, it is an error on the server side. Therefore, the service implementation should generate a response to the client application with the HTTP status of "500 Internal Server Error".

    getResponseContent() 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 service 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 getResponseContent())
    BAD_REQUEST

    When the value of "action" is "BAD_REQUEST", it means that Authlete's /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".

    getResponseContent() 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 service 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 getResponseContent())
    Since:
    Authlete 1.1
    Author:
    Takahiko Kawasaki
    See Also:
    Serialized Form
    • Constructor Detail

      • TokenFailResponse

        public TokenFailResponse()
    • Method Detail

      • getAction

        public TokenFailResponse.Action getAction()
        Get the next action that the service implementation should take.
      • setAction

        public void setAction​(TokenFailResponse.Action action)
        Set the next action that the service implementation should take.
      • getResponseContent

        public String getResponseContent()
        Get the response content which can be used as the entity body of the response returned to the client application.
      • setResponseContent

        public void setResponseContent​(String content)
        Set the response content which can be used as the entity body of the response returned to the client application.
      • summarize

        public String summarize()
        Get the summary of this instance.