Class ResourceServerSignatureResponse

  • All Implemented Interfaces:
    Serializable

    public class ResourceServerSignatureResponse
    extends ApiResponse
    Response from Authlete's /api/rs/sign API.

    Authlete's /api/rs/sign API returns JSON which can be mapped to this class. The resource 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 the response message has been successfully signed.

    The resource server implementation should generate a response to the client application with its intended response code and, if applicable, message payload.

    The resource server implementation should add the headers in this response object to the HTTP response message before returning it to the client.

    getSignature() (REQUIRED)

    The serialized value for the Signature header applied to the response.

    getSignatureInput() (REQUIRED)

    The serialized value for the Signature-Input header applied to the response.

    getContentDigest() (OPTIONAL)

    The serialized value for the Content-Digest header applied to the response. This value is only returned if a message was passed to the request, otherwise it is null.

    The following illustrate responses which the resource 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
     Signature: (The value returned from getSignature())
     Signature-Input: (The value returned from getSignatureInput())
     
     HTTP/1.1 200 OK
     Content-Type: application/json
     Cache-Control: no-store
     Pragma: no-cache
     Signature: (The value returned from getSignature())
     Signature-Input: (The value returned from getSignatureInput())
     Content-Digest: (The value returned from getContentDigest())
     Content-Type: text/plain
     
     Hello, world!
     

    BAD_REQUEST

    When the value of action is BAD_REQUEST, it means that the request was wrong.

    The resource server implementation should generate a response to the client application with 400 Bad Request.

    INTERNAL_SERVER_ERROR

    When the value of action is INTERNAL_SERVER_ERROR, it means that the API call from the resource server implementation 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 resource server implementation should generate a response to the client application with 500 Internal Server Error.


    Since:
    3.38, Authlete 2.3
    See Also:
    Serialized Form
    • Constructor Detail

      • ResourceServerSignatureResponse

        public ResourceServerSignatureResponse()
    • Method Detail

      • getSignature

        public String getSignature()
        Get the Signature header value to add to the response message.
        Returns:
        The serialized header value.
      • setSignature

        public ResourceServerSignatureResponse setSignature​(String signature)
        Set the Signature header value to add to the response message.
        Parameters:
        signature - The serialized header value.
        Returns:
        this object.
      • getSignatureInput

        public String getSignatureInput()
        Get the Signature-Input header value to add to the response message.
        Returns:
        The serialized header value.
      • setSignatureInput

        public ResourceServerSignatureResponse setSignatureInput​(String signatureInput)
        Set the Signature-Input header value to add to the response message.
        Parameters:
        signatureInput - The serialized header value.
        Returns:
        this object.
      • getContentDigest

        public String getContentDigest()
        Get the Content-Digest header value to add to the response message.
        Returns:
        The serialized header value.
      • setContentDigest

        public ResourceServerSignatureResponse setContentDigest​(String contentDigest)
        Set the Content-Digest header value to add to the response message.
        Parameters:
        contentDigest - The serialized header value.
        Returns:
        this object.
      • summarize

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