Class AuthorizationAuthenticateResponse

  • All Implemented Interfaces:
    Serializable

    public class AuthorizationAuthenticateResponse
    extends ApiResponse
    Response from Authlete's /auth/authorization/authenticate API.

    Authlete's /auth/authorization/authenticate 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 (AuthorizationAuthenticateRequest) was wrong or that an error occurred in Authlete.

    The service implementation should generate a response 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.

     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 the ticket is no longer valid (deleted or expired).

    The HTTP status of the response returned should be "400 Bad Request".

    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.

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

    When the value of "action" is "OK", it means that the response should be "200 OK".

    getResponseContent() returns a JSON string which contains the result of authentication. When the authentication succeeded, the subject of the authenticated end-user and optionally his/her claim values are contained in the response.

    The following illustrates the response which the service implementation should generate.

     HTTP/1.1 200 OK
     Content-Type: application/json
     Cache-Control: no-store
     Pragma: no-cache
    
     (The value returned from getResponseContent())
    Author:
    Takahiko Kawasaki
    See Also:
    Serialized Form
    • Constructor Detail

      • AuthorizationAuthenticateResponse

        public AuthorizationAuthenticateResponse()
    • Method Detail

      • isAuthenticated

        public boolean isAuthenticated()
        Get the result of the authentication.
        Returns:
        true if authenticated.
        Since:
        1.15
      • setAuthenticated

        public void setAuthenticated​(boolean authenticated)
        Set the result of the authentication.
        Parameters:
        authenticated - true if authenticated.
        Since:
        1.15
      • getResponseContent

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

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

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