Class CredentialDeferredIssueResponse

  • All Implemented Interfaces:
    Serializable

    public class CredentialDeferredIssueResponse
    extends ApiResponse
    A response from Authlete's /vci/deferred/issue API.

    A response from the /vci/deferred/issue API can be mapped to this class. The API caller should extract the value of the action parameter from the API response and take the next action based on the value of the parameter.


    action = OK

    The action value OK means that a credential has been issued successfully. In this case, the implementation of the deferred credential endpoint should return a successful response to the request sender. The HTTP status code and the content type of the response should be 200 and application/json, respectively. The value of the responseContent parameter can be used as the message body of the response. It contains the "credential" parameter that conforms to the specification of "Deferred Credential Response".

     HTTP/1.1 200 OK
     Content-Type: application/json
     Cache-Control: no-store
    
     (Put the value of the "responseContent" parameter here.)
     

    action = OK_JWT

    The action value OK_JWT means that a credential has been issued successfully and the deferred credential response should be encrypted. In this case, the implementation of the deferred credential endpoint should return a successful response to the request sender. The HTTP status code and the content type of the response should be 200 and application/jwt, respectively. The value of the responseContent parameter is an encrypted JWT and can be used as the message body of the response.

     HTTP/1.1 200 OK
     Content-Type: application/jwt
     Cache-Control: no-store
    
     (Put the value of the "responseContent" parameter here.)
     

    action = BAD_REQUEST

    The action value BAD_REQUEST means that the original deferred credential request is wrong. In this case, the implementation of the deferred credential endpoint should return an error response to the request sender. The HTTP status code and the content type of the error response should be 400 and application/json, respectively. The value of the responseContent parameter can be used as the message body of the error response as it conforms to the specification of "Deferred Credential Error Response".

     HTTP/1.1 400 Bad Request
     Content-Type: application/json
     Cache-Control: no-store
    
     (Put the value of the "responseContent" parameter here.)
     

    action = FORBIDDEN

    The action value FORBIDDEN means that the use of the Authlete API is forbidden. In this case, the implementation of the deferred credential endpoint should return an error response to the request sender. The HTTP status code and the content type of the error response should be 403 and application/json, respectively. The value of the responseContent parameter can be used as the message body of the error response as it conforms to the specification of "Deferred Credential Error Response".

     HTTP/1.1 403 Forbidden
     Content-Type: application/json
     Cache-Control: no-store
    
     (Put the value of the "responseContent" parameter here.)
     

    Note that this happens either when the verifiableCredentialsEnabled property of the service is false or when the Authlete server does not support the feature of "Verifiable Credentials". In either case, this "forbidden" issue should be solved before the service is deployed in a production environment.


    action = INTERNAL_SERVER_ERROR

    The action value INTERNAL_SERVER_ERROR means that something wrong happened on Authlete side. In this case, the implementation of the deferred credential endpoint should return an error response to the request sender. The HTTP status code and the content type of the error response should be 500 and application/json, respectively. The value of the responseContent parameter can be used as the message body of the error response as it conforms to the specification of "Deferred Credential Error Response".

     HTTP/1.1 500 Internal Server Error
     Content-Type: application/json
     Cache-Control: no-store
    
     (Put the value of the "responseContent" parameter here.)
     

    Note that, however, in real production deployments, it may be better to return a vaguer error response instead of a bare one like above.


    action = CALLER_ERROR

    The action value CALLER_ERROR means that the API call is wrong. For example, the "order" request parameter is missing.

    Caller errors should be solved before the service is deployed in a production environment.

    Since:
    3.70, Authlete 3.0
    See Also:
    Serialized Form
    • Constructor Detail

      • CredentialDeferredIssueResponse

        public CredentialDeferredIssueResponse()
    • Method Detail

      • getAction

        public CredentialDeferredIssueResponse.Action getAction()
        Get the next action that the implementation of the deferred credential endpoint should take.
        Returns:
        The next action.
      • getResponseContent

        public String getResponseContent()
        Get the content of the response that the implementation of the deferred credential endpoint should return.
        Returns:
        The content of the response returned from the deferred credential endpoint.
      • setResponseContent

        public CredentialDeferredIssueResponse setResponseContent​(String responseContent)
        Set the content of the response that the implementation of the deferred credential endpoint should return.
        Parameters:
        responseContent - The content of the response returned from the deferred credential endpoint.
        Returns:
        this object.