Class AttestationChallengeResponse
- java.lang.Object
-
- com.authlete.common.dto.ApiResponse
-
- com.authlete.common.dto.AttestationChallengeResponse
-
- All Implemented Interfaces:
Serializable
public class AttestationChallengeResponse extends ApiResponse
Response from Authlete's/attestation/challengeAPI.The Authlete API is supposed to be used from within the implementation the challenge endpoint of the authorization server.
Authlete's
/attestation/challengeAPI returns JSON which can be mapped to this class. The authorization server implementation should retrieve the value of theresponse parameter from the API response and take the following steps according to the value.actionOKWhen the value of the
response parameter isaction, it means that Authlete could prepare a challenge response successfully.OK
In this case, the implementation of the challenge endpoint of the authorization server should return an HTTP response with the HTTP status code "200 OK" and the content type "application/json". The message body of the response has been prepared by Authlete's/attestation/challengeAPI and it is available as theresponse parameter.responseContentThe implementation of the challenge endpoint can construct an HTTP response by doing like below.
200 OK Content-Type: application/json Cache-Control: no-store (Other HTTP headers) (the value of the
responseContentresponse parameter)Note that the OAuth 2.0 Attestation-Based Client Authentication specification requires the response to include the
Cache-Controlheader including the valueno-store.INTERNAL_SERVER_ERRORWhen the value of the
In this case, a simple implementation of the challenge endpoint would return an HTTP response with the HTTP status code "response parameter isaction, it means that an unexpected error has occurred on Authlete side or the service has not been set up properly yet.INTERNAL_SERVER_ERROR500 Internal Server Error" and the content type "application/json". The message body (= error information in the JSON format) of the response has been prepared by Authlete's/attestation/challengeAPI and it is available as theresponse parameter.responseContentSuch simple implementation of the challenge endpoint can construct an HTTP response by doing like below.
500 Internal Server Error Content-Type: application/json (Other HTTP headers) (the value of the
responseContentresponse parameter)However, in real commercial deployments, it is rare for an authorization server to return "
500 Internal Server Error" when it encounters an unexpected internal error. It's up to implementations of authorization servers what they actually return in the case of internal server error.- Since:
- 4.39, Authlete 3.0.28
- See Also:
- OAuth 2.0 Attestation-Based Client Authentication, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAttestationChallengeResponse.ActionThe next action that the implementation of the challenge endpoint should take after getting a response from Authlete's/attestation/challengeAPI.
-
Constructor Summary
Constructors Constructor Description AttestationChallengeResponse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AttestationChallengeResponse.ActiongetAction()Get the next action that the implementation of the challenge endpoint should take after getting a response from Authlete's/attestation/challengeAPI.StringgetAttestationChallenge()Get theattestation_challengevalue generated by the/attestation/challengeAPI.StringgetResponseContent()Get the content that the implementation of the challenge endpoint should use when it constructs a response.AttestationChallengeResponsesetAction(AttestationChallengeResponse.Action action)Set the next action that the implementation of the challenge endpoint should take after getting a response from Authlete's/attestation/challengeAPI.AttestationChallengeResponsesetAttestationChallenge(String challenge)Set theattestation_challengevalue generated by the/attestation/challengeAPI.AttestationChallengeResponsesetResponseContent(String content)Set the content that the implementation of the challenge endpoint should use when it constructs a response.-
Methods inherited from class com.authlete.common.dto.ApiResponse
getResponseHeaders, getResultCode, getResultMessage, setResponseHeaders, setResultCode, setResultMessage
-
-
-
-
Method Detail
-
getAction
public AttestationChallengeResponse.Action getAction()
Get the next action that the implementation of the challenge endpoint should take after getting a response from Authlete's/attestation/challengeAPI.- Returns:
- The next action.
-
setAction
public AttestationChallengeResponse setAction(AttestationChallengeResponse.Action action)
Set the next action that the implementation of the challenge endpoint should take after getting a response from Authlete's/attestation/challengeAPI.- Parameters:
action- The next action.- Returns:
thisobject.
-
getResponseContent
public String getResponseContent()
Get the content that the implementation of the challenge endpoint should use when it constructs a response.- Returns:
- The response content in the JSON format.
-
setResponseContent
public AttestationChallengeResponse setResponseContent(String content)
Set the content that the implementation of the challenge endpoint should use when it constructs a response.- Parameters:
content- The response content in the JSON format.- Returns:
thisobject.
-
getAttestationChallenge
public String getAttestationChallenge()
Get theattestation_challengevalue generated by the/attestation/challengeAPI.- Returns:
- The generated
attestation_challengevalue.
-
setAttestationChallenge
public AttestationChallengeResponse setAttestationChallenge(String challenge)
Set theattestation_challengevalue generated by the/attestation/challengeAPI.- Parameters:
challenge- The generatedattestation_challengevalue.- Returns:
thisobject.
-
-