Class BackchannelAuthenticationIssueResponse

  • All Implemented Interfaces:
    Serializable

    public class BackchannelAuthenticationIssueResponse
    extends ApiResponse
    Response from Authlete's /api/backchannel/authentication/issue API.

    Authlete's /api/backchannel/authentication/issue API returns JSON which can be mapped to this class. The authorization server implementation should retrieve the value of action from the response and take the following steps according to the value.

    OK

    When the value of action is OK, it means that Authlete has succeeded in preparing JSON that contains an auth_req_id. The JSON should be used as the response body of the response which is returned to the client from the backchannel authentication endpoint. The getResponseContent() method returns the JSON.

    The following illustrates the response which the authorization server implementation should generate and return to the client application.

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

    INTERNAL_SERVER_ERROR

    When the value of action is INTERNAL_SERVER_ERROR, it means that an error occurred in Authlete.

    From a viewpoint of the client application, this is an error on the server side. Therefore, the authorization server implementation should generate a response to the client application with 500 Internal Server Error and application/json.

    The getResponseContent() method 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 getResponseContent())

    INVALID_TICKET

    When the value of action is INVALID_TICKET, it means that the ticket included in the API call was invalid. For example, it does not exist or has expired.

    From a viewpoint of the client application, this is an error on the server side. Therefore, the authorization server implementation should generate a response to the client application with 500 Internal Server Error and application/json.

    You can build an error response in the same way as shown in the description for the case of INTERNAL_SERVER_ERROR.


    Since:
    2.32, Authlete 2.0.0
    See Also:
    Serialized Form
    • Constructor Detail

      • BackchannelAuthenticationIssueResponse

        public BackchannelAuthenticationIssueResponse()
    • Method Detail

      • getResponseContent

        public String getResponseContent()
        Get the content of the response body of the response to the client application. Its format is JSON.

        In successful cases, the content contains auth_req_id. In error cases, the content contains error.

        Returns:
        The content of the response body of the response to the client application.
      • setResponseContent

        public BackchannelAuthenticationIssueResponse setResponseContent​(String responseContent)
        Set the content of the response body of the response to the client application.
        Parameters:
        responseContent - The content of the response body of the response to the client application.
        Returns:
        this object.
      • getAuthReqId

        public String getAuthReqId()
        Get the issued authentication request ID. This corresponds to the auth_req_id property in the response to the client.
        Returns:
        The issued authentication request ID (auth_req_id).
      • setAuthReqId

        public BackchannelAuthenticationIssueResponse setAuthReqId​(String authReqId)
        Set the issued authentication request ID. This corresponds to the auth_req_id property in the response to the client.
        Parameters:
        authReqId - The issued authentication request ID (auth_req_id).
        Returns:
        this object.
      • getExpiresIn

        public int getExpiresIn()
        Get the duration of the issued authentication request ID in seconds. This corresponds to the expires_in property in the response to the client.
        Returns:
        The duration of the issued authentication request ID in seconds (expires_in).
      • setExpiresIn

        public BackchannelAuthenticationIssueResponse setExpiresIn​(int expiresIn)
        Set the duration of the issued authentication request ID in seconds. This corresponds to the expires_in property in the response to the client.
        Parameters:
        expiresIn - The duration of the issued authentication request ID in seconds (expires_in).
        Returns:
        this object.
      • getInterval

        public int getInterval()
        Get the minimum amount of time in seconds that the client must wait for between polling requests to the token endpoint. This corresponds to the interval property in the response to the client.

        The value returned from this method has no meaning when the backchannel token delivery mode is "push".

        Returns:
        The minimum amount of time in seconds between polling requests.
      • setInterval

        public BackchannelAuthenticationIssueResponse setInterval​(int interval)
        Set the minimum amount of time in seconds that the client must wait for between polling requests to the token endpoint. This corresponds to the interval property in the response to the client.
        Parameters:
        interval - The minimum amount of time in seconds between polling requests.
        Returns:
        this object.