Class CredentialDeferredIssueRequest

  • All Implemented Interfaces:
    Serializable

    public class CredentialDeferredIssueRequest
    extends Object
    implements Serializable
    A request to Authlete's /vci/deferred/issue API.

    The Authlete API is supposed to be called by the implementation of the deferred credential endpoint. The endpoint is defined in the "OpenID for Verifiable Credential Issuance 1.0" (OID4VCI) specification.

    The implementation of the deferred credential endpoint is expected to call the following Authlete APIs in the order.

    1. /auth/introspection
    2. /vci/deferred/parse
    3. /vci/deferred/issue

    The /vci/deferred/issue API is used for one of the following purposes:

    1. To issue a credential
    2. To deny the deferred credential request
    3. To notify that the requested credential is not ready yet

    Issuing a credential

    To issue a credential, the order request parameter must be set up properly, and both the denied and order.issuanceDeferred request parameters must be set to false.

    Denying a deferred credential request

    To deny the deferred credential request, the denied request parameter in the API call must be set to true. In this case, Authlete prepares a response containing "error":"credential_request_denied" and returns "action":"BAD_REQUEST".

    Note that the credential_request_denied error code does not exist in OID4VCI 1.0 ID1. Therefore, you should not call the API with denied set to true when the target specification version is "1.0-ID1".

    Notifying that the credential is not ready yet

    To notify that the requested credential is not ready yet, the order.issuanceDeferred request parameter in the API call must be set to true. In this case, Authlete will do one of the following:

    1. Prepare an error response with the issuance_pending error code for OID4VCI 1.0 ID1.
    2. Prepare a successful response containing the transaction_id and interval parameters for OID4VCI 1.0 Final or later.

    Note that if the Authlete Server version is older than 3.0.25 and the target specification version is "1.0-ID1", you need to manually construct an error response as shown below, without using the /vci/deferred/issue API.

     HTTP/1.1 400 Bad Request
     Content-Type: application/json
     Cache-Control: no-store
    
     {
       "error": "issuance_pending"
     }
     

    Interval handling

    If the interval request parameter in the API call is present and its value is positive, it is used as the value of the interval response parameter in the deferred credential response. If the interval request parameter is missing, zero, or negative, Authlete uses the default value.

    Note that the interval response parameter does not exist in OID4VCI 1.0 ID1. Therefore, you don't have to care about the interval request parameter if the target specification version is "1.0-ID1".

    Important note

    In all cases, the order.requestIdentifier request parameter must be set properly.

    Since:
    3.70, Authlete 3.0
    See Also:
    OpenID for Verifiable Credential Issuance 1.0, Serialized Form
    • Constructor Detail

      • CredentialDeferredIssueRequest

        public CredentialDeferredIssueRequest()
    • Method Detail

      • getOrder

        public CredentialIssuanceOrder getOrder()
        Get the credential order that provides an instruction for issuing a credential.
        Returns:
        The instruction for credential issuance.
      • isDenied

        public boolean isDenied()
        Get the flag that indicates whether to deny the deferred credential request.

        If this parameter is set to true, the response content prepared by Authlete will contain "error":"credential_request_denied" like below.

         {
             "error": "credential_request_denied"
         }
         

        Note that the credential_request_denied error code does not exist in OID4VCI 1.0 ID1.

        Returns:
        true for generating a response content containing "error":"credential_request_denied".
        Since:
        4.35, Authlete 3.0.25
      • setDenied

        public CredentialDeferredIssueRequest setDenied​(boolean denied)
        Set the flag that indicates whether to deny the deferred credential request.

        If this parameter is set to true, the response content prepared by Authlete will contain "error":"credential_request_denied" like below.

         {
             "error": "credential_request_denied"
         }
         

        Note that the credential_request_denied error code does not exist in OID4VCI 1.0 ID1.

        Parameters:
        denied - true for generating a response content containing "error":"credential_request_denied".
        Returns:
        this object.
        Since:
        4.35, Authlete 3.0.25
      • getInterval

        public int getInterval()
        Get the minimum amount of time in seconds that the Wallet SHOULD wait after receiving the response before sending a new request to the Deferred Credential Endpoint.

        The value of this parameter is used as the value of the interval parameter in the deferred credential response. However, the interval parameter is included in the deferred credential response only when the following conditions are met:

        • The value of the order.issuanceDeferred request parameter is true.
        • The version of the OID4VCI specification is 1.0-Final or later (that is, the oid4vciVersion property of Service is set and its value is not "1.0-ID1").
        Returns:
        The minimum amount of time in seconds that the Wallet SHOULD wait after receiving the response before sending a new request to the Deferred Credential Endpoint.
        Since:
        4.35, Authlete 3.0.25
      • setInterval

        public CredentialDeferredIssueRequest setInterval​(int interval)
        Set the minimum amount of time in seconds that the Wallet SHOULD wait after receiving the response before sending a new request to the Deferred Credential Endpoint.

        The value of this parameter is used as the value of the interval parameter in the deferred credential response. However, the interval parameter is included in the deferred credential response only when the following conditions are met:

        • The value of the order.issuanceDeferred request parameter is true.
        • The version of the OID4VCI specification is 1.0-Final or later (that is, the oid4vciVersion property of Service is set and its value is not "1.0-ID1").
        Parameters:
        interval - The minimum amount of time in seconds that the Wallet SHOULD wait after receiving the response before sending a new request to the Deferred Credential Endpoint.
        Returns:
        this object.
        Since:
        4.35, Authlete 3.0.25