Class ResourceServerSignatureResponse
- java.lang.Object
-
- com.authlete.common.dto.ApiResponse
-
- com.authlete.common.dto.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 ofaction
from the response and take the following steps according to the value.OK
-
When the value of
action
isOK
, 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 amessage
was passed to the request, otherwise it isnull
.
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 fromgetSignatureInput()
)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 fromgetSignatureInput()
) Content-Digest: (The value returned fromgetContentDigest()
) Content-Type: text/plain Hello, world!
BAD_REQUEST
-
When the value of
action
isBAD_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
isINTERNAL_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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ResourceServerSignatureResponse.Action
The next action the resource server implementation should take.
-
Constructor Summary
Constructors Constructor Description ResourceServerSignatureResponse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceServerSignatureResponse.Action
getAction()
Get the next action that the resource server should take.String
getContentDigest()
Get theContent-Digest
header value to add to the response message.String
getSignature()
Get theSignature
header value to add to the response message.String
getSignatureInput()
Get theSignature-Input
header value to add to the response message.ResourceServerSignatureResponse
setAction(ResourceServerSignatureResponse.Action action)
Set the next action that the resource server should take.ResourceServerSignatureResponse
setContentDigest(String contentDigest)
Set theContent-Digest
header value to add to the response message.ResourceServerSignatureResponse
setSignature(String signature)
Set theSignature
header value to add to the response message.ResourceServerSignatureResponse
setSignatureInput(String signatureInput)
Set theSignature-Input
header value to add to the response message.String
summarize()
Get the summary of this instance.-
Methods inherited from class com.authlete.common.dto.ApiResponse
getResultCode, getResultMessage, setResultCode, setResultMessage
-
-
-
-
Method Detail
-
getSignature
public String getSignature()
Get theSignature
header value to add to the response message.- Returns:
- The serialized header value.
-
setSignature
public ResourceServerSignatureResponse setSignature(String signature)
Set theSignature
header value to add to the response message.- Parameters:
signature
- The serialized header value.- Returns:
this
object.
-
getSignatureInput
public String getSignatureInput()
Get theSignature-Input
header value to add to the response message.- Returns:
- The serialized header value.
-
setSignatureInput
public ResourceServerSignatureResponse setSignatureInput(String signatureInput)
Set theSignature-Input
header value to add to the response message.- Parameters:
signatureInput
- The serialized header value.- Returns:
this
object.
-
getContentDigest
public String getContentDigest()
Get theContent-Digest
header value to add to the response message.- Returns:
- The serialized header value.
-
setContentDigest
public ResourceServerSignatureResponse setContentDigest(String contentDigest)
Set theContent-Digest
header value to add to the response message.- Parameters:
contentDigest
- The serialized header value.- Returns:
this
object.
-
getAction
public ResourceServerSignatureResponse.Action getAction()
Get the next action that the resource server should take.- Returns:
- The action.
-
setAction
public ResourceServerSignatureResponse setAction(ResourceServerSignatureResponse.Action action)
Set the next action that the resource server should take.- Parameters:
action
- The action.- Returns:
this
object.
-
summarize
public String summarize()
Get the summary of this instance.- Returns:
- The summary of this instance.
-
-