Class CredentialDeferredIssueRequest
- java.lang.Object
-
- com.authlete.common.dto.CredentialDeferredIssueRequest
-
- All Implemented Interfaces:
Serializable
public class CredentialDeferredIssueRequest extends Object implements Serializable
A request to Authlete's/vci/deferred/issueAPI.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.
/auth/introspection/vci/deferred/parse/vci/deferred/issue
The
/vci/deferred/issueAPI is used for one of the following purposes:- To issue a credential
- To deny the deferred credential request
- To notify that the requested credential is not ready yet
Issuing a credential
To issue a credential, the
orderrequest parameter must be set up properly, and both thedeniedandorder.issuanceDeferredrequest parameters must be set tofalse.Denying a deferred credential request
To deny the deferred credential request, the
deniedrequest parameter in the API call must be set totrue. In this case, Authlete prepares a response containing"error":"credential_request_denied"and returns"action":".BAD_REQUEST"Note that the
credential_request_deniederror code does not exist in OID4VCI 1.0 ID1. Therefore, you should not call the API withdeniedset totruewhen 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.issuanceDeferredrequest parameter in the API call must be set totrue. In this case, Authlete will do one of the following:-
Prepare an error response with the
issuance_pendingerror code for OID4VCI 1.0 ID1. -
Prepare a successful response containing the
transaction_idandintervalparameters 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/issueAPI.HTTP/1.1 400 Bad Request Content-Type: application/json Cache-Control: no-store { "error": "issuance_pending" }Interval handling
If the
intervalrequest parameter in the API call is present and its value is positive, it is used as the value of theintervalresponse parameter in the deferred credential response. If theintervalrequest parameter is missing, zero, or negative, Authlete uses the default value.Note that the
intervalresponse parameter does not exist in OID4VCI 1.0 ID1. Therefore, you don't have to care about theintervalrequest parameter if the target specification version is "1.0-ID1".Important note
In all cases, the
order.requestIdentifierrequest parameter must be set properly.- Since:
- 3.70, Authlete 3.0
- See Also:
- OpenID for Verifiable Credential Issuance 1.0, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CredentialDeferredIssueRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetInterval()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.CredentialIssuanceOrdergetOrder()Get the credential order that provides an instruction for issuing a credential.booleanisDenied()Get the flag that indicates whether to deny the deferred credential request.CredentialDeferredIssueRequestsetDenied(boolean denied)Set the flag that indicates whether to deny the deferred credential request.CredentialDeferredIssueRequestsetInterval(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.CredentialDeferredIssueRequestsetOrder(CredentialIssuanceOrder order)Set the credential order that provides an instruction for issuing a credential.
-
-
-
Method Detail
-
getOrder
public CredentialIssuanceOrder getOrder()
Get the credential order that provides an instruction for issuing a credential.- Returns:
- The instruction for credential issuance.
-
setOrder
public CredentialDeferredIssueRequest setOrder(CredentialIssuanceOrder order)
Set the credential order that provides an instruction for issuing a credential.- Parameters:
order- The instruction for credential issuance.- Returns:
thisobject.
-
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_deniederror code does not exist in OID4VCI 1.0 ID1.- Returns:
truefor 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_deniederror code does not exist in OID4VCI 1.0 ID1.- Parameters:
denied-truefor generating a response content containing"error":"credential_request_denied".- Returns:
thisobject.- 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
intervalparameter in the deferred credential response. However, theintervalparameter is included in the deferred credential response only when the following conditions are met:-
The value of the
order.issuanceDeferredrequest parameter istrue. -
The version of the OID4VCI specification is 1.0-Final or later (that is,
the
oid4vciVersionproperty ofServiceis 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
-
The value of the
-
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
intervalparameter in the deferred credential response. However, theintervalparameter is included in the deferred credential response only when the following conditions are met:-
The value of the
order.issuanceDeferredrequest parameter istrue. -
The version of the OID4VCI specification is 1.0-Final or later (that is,
the
oid4vciVersionproperty ofServiceis 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:
thisobject.- Since:
- 4.35, Authlete 3.0.25
-
The value of the
-
-