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/signAPI.Authlete's
/api/rs/signAPI returns JSON which can be mapped to this class. The resource server implementation should retrieve the value ofactionfrom the response and take the following steps according to the value.OK-
When the value of
actionisOK, 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
Signatureheader applied to the response. getSignatureInput()(REQUIRED)-
The serialized value for the
Signature-Inputheader applied to the response. getContentDigest()(OPTIONAL)-
The serialized value for the
Content-Digestheader applied to the response. This value is only returned if amessagewas 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
actionisBAD_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
actionisINTERNAL_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 classResourceServerSignatureResponse.ActionThe 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.ActiongetAction()Get the next action that the resource server should take.StringgetContentDigest()Get theContent-Digestheader value to add to the response message.StringgetSignature()Get theSignatureheader value to add to the response message.StringgetSignatureInput()Get theSignature-Inputheader value to add to the response message.ResourceServerSignatureResponsesetAction(ResourceServerSignatureResponse.Action action)Set the next action that the resource server should take.ResourceServerSignatureResponsesetContentDigest(String contentDigest)Set theContent-Digestheader value to add to the response message.ResourceServerSignatureResponsesetSignature(String signature)Set theSignatureheader value to add to the response message.ResourceServerSignatureResponsesetSignatureInput(String signatureInput)Set theSignature-Inputheader value to add to the response message.Stringsummarize()Get the summary of this instance.-
Methods inherited from class com.authlete.common.dto.ApiResponse
getResponseHeaders, getResultCode, getResultMessage, setResponseHeaders, setResultCode, setResultMessage
-
-
-
-
Method Detail
-
getSignature
public String getSignature()
Get theSignatureheader value to add to the response message.- Returns:
- The serialized header value.
-
setSignature
public ResourceServerSignatureResponse setSignature(String signature)
Set theSignatureheader value to add to the response message.- Parameters:
signature- The serialized header value.- Returns:
thisobject.
-
getSignatureInput
public String getSignatureInput()
Get theSignature-Inputheader value to add to the response message.- Returns:
- The serialized header value.
-
setSignatureInput
public ResourceServerSignatureResponse setSignatureInput(String signatureInput)
Set theSignature-Inputheader value to add to the response message.- Parameters:
signatureInput- The serialized header value.- Returns:
thisobject.
-
getContentDigest
public String getContentDigest()
Get theContent-Digestheader value to add to the response message.- Returns:
- The serialized header value.
-
setContentDigest
public ResourceServerSignatureResponse setContentDigest(String contentDigest)
Set theContent-Digestheader value to add to the response message.- Parameters:
contentDigest- The serialized header value.- Returns:
thisobject.
-
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:
thisobject.
-
summarize
public String summarize()
Get the summary of this instance.- Returns:
- The summary of this instance.
-
-