This section describes how a Relying Party Instance requests to a Wallet Instance the presentation of the PID/EAAs.
In this section the following flows are described:
Remote Flow, where the User presents a Digital Credential to a web Relying Party Instance according to OpenID4VP. In this scenario the user-agent and the Wallet Instance can be used in the same device (Same Device Flow), or in different devices (Cross Device Flow).
Proximity Flow, where the User presents a Digital Credential to a mobile Relying Party Instance according to ISO18013-5. The User interacts with a Verifier using proximity connection technologies such as using QR Codes and Bluetooth Low Energy (BLE).
Depending on whether the User is using a mobile device or a workstation, the Relying Party MUST support the following remote flows:
Same Device, the Relying Party MUST provide an HTTP location to the Wallet Instance using a redirect (302) or an HTML href in a web page;
Cross Device, the Relying Party MUST provide a QR Code which the User frames with the Wallet Instance.
Once the Wallet Instance establishes the trust with the Relying Party and evaluates the request, the User gives the consent for the disclosure of the Digital Credentials, in the form of a Verifiable Presentation.
A High-Level description of the remote flow, from the User's perspective, is given below and shown in High Level Remote Protocol Flow:
Authorization Request: the Wallet Instance obtains a URL in the Same Device flow or a QR Code containing the URL in Cross Device flow where the signed presentation Request Object is available for download.
Request URI Request: the Wallet Instance extracts from the payload the following parameters: client_id, request_uri, state, request_uri_method.
If request_uri_method is provided and set with the value post, the Wallet Instance SHOULD transmit its metadata to the Relying Party's request_uri endpoint using the HTTP POST method.
If request_uri_method is set with the value get or not present, the Wallet Instance MUST fetch the signed Request Object using an HTTP request with method GET to the endpoint provided in the request_uri parameter.
Request URI Response: the Relying Party returns a signed Request Object to the Wallet Instance.
WI Checks: the Wallet Instance:
verifies the signature of the signed Request Object using the public key identified in the JWT header of the Request Object. Using that reference, the Wallet Instance is able to select the correct Relying Party's public key for signature verification.
verifies that the client_id contained in the Request Object issuer (Relying Party) matches with the one obtained at the step number 2 and with the sub parameter contained in the Relying Party's Entity Configuration within the Trust Chain.
evaluates the requested Digital Credentials and checks the eligibility of the Relying Party in asking for these by applying the policies related to that specific Relying Party, obtained with the Trust Chain.
User Consent: the Wallet Instance asks User disclosure and consent by showing the Relying Party's identity and the requested attributes.
POST Authorization Response: the Wallet Instance presents the requested information to the Relying Party, along with the Wallet Attestation if requested.
RP Checks: The Relying Party validates the presented Credentials by verifying the trust with their Issuers and checks the Wallet Attestation to ensure the Wallet Provider is trusted.
Relying Party Response: the Wallet Instance informs the User about the successful authentication with the Relying Party, and the User continues the navigation.
Below is a sequence diagram that details the interactions between all the involved parties.
The details of each step shown in the previous picture are described below.
Steps 1-2: The User requests to access to a protected resource of the Relying Party.
Steps 3-5: The Relying Party creates a state value bound to the user-agent (e.g., using an HTTP secured cookie), the Request Object available for download at the request_uri location. It then inspects the user-agent to determine whether the flow occurs on the same device as the user-agent.
Steps 6-9 (Authorization Request): The Relying Party provides the user-agent with a JavaScript page inspecting the status endpoint and the Wallet Instance with a URL containing the Authorization Request.
In the Cross Device Flow, the Request URI is presented as a QR Code displayed to the User. The User scans the QR Code using the Wallet Instance and retrieves a URL with the parameters client_id, request_uri, state and request_uri_method.
Below is represented a non-normative example of a QR Code issued by the Relying Party.
Below is represented a non-normative example of the QR Code raw payload:
The error correction level chosen for the QR Code MUST be Q (Quartily - up to 25%), since it offers a good balance between error correction capability and data density/space. This level of quality and error correction allows the QR Code to remain readable even if it is damaged or partially obscured.
Conversely, in the Same Device Flow, the Relying Party uses an HTTP response redirect (with status code set to 302) or an html page with an href button, containing the URL providing the same information as in the Cross-Device Flow. Below is a non-normative example:
Step 10: The Wallet Instance evaluates the trust with the Relying Party.
Steps 11-13 (Request URI Request): The Wallet Instance checks if the Relying Party has provided the request_uri_method within its signed Request Object.
If it is provided and is equal to post, the Wallet Instance SHOULD provide its metadata to the Relying Party. The Relying Party updates the Request Object according with the Wallet technical capabilities.
The following is a non-normative example of an HTTP request made by the Wallet Instance to the Relying Party.
When the Wallet Instance capabilities discovery is not supported by Relying Party, the Wallet Instance requests the signed Request Object using the HTTP method GET.
Step 14 (Request URI Response): The Relying Party issues the Request Object signing it using one of its cryptographic private keys, where their public parts have been published within its Entity Configuration (metadata.openid_credential_verifier.jwks). The Wallet Instance obtains the signed Request Object.
Below is a non-normative example of the Redirect URI Response:
{"client_id":"https://relying-party.example.org","response_mode":"direct_post.jwt","response_type":"vp_token","dcql_query":{"credentials":[{"id":"personal id data","format":"dc+sd-jwt","meta":{"vct_values":["https://trust-registry.eid-wallet.example.it/credentials/v1.0/personidentificationdata"]},"claims":[{"path":["given_name"]},{"path":["family_name"]},{"path":["personal_administrative_number"]}]},{"id":"wallet attestation","format":"dc+sd-jwt","meta":{"vct_values":["https://itwallet.registry.example.it/WalletAttestation"]},"claims":[{"path":["wallet_link"]},{"path":["wallet_name"]}]}]},"response_uri":"https://relying-party.example.org/response_uri","nonce":"2c128e4d-fc91-4cd3-86b8-18bdea0988cb","wallet_nonce":"qPmxiNFCR3QTm19POc8u","state":"3be39b69-6ac1-41aa-921b-3e6c07ddcb03","iss":"https://relying-party.example.org","iat":1672418465,"exp":1672422065,"request_uri_method":"post"}
Steps 15-17 (WI Checks): The Wallet Instance verifies the Request Object, which is in the form of a signed JWT. It then processes the Relying Party metadata and applies the relevant policies to determine which Digital Credentials and User data the Relying Party is authorized to request.
Steps 18-19 (User Consent): The Wallet Instance requests the User's consent to disclose the requested Credentials by showing the Relying Party's identity and the requested attributes. The User authorizes and consents the presentation of the Credentials by selecting/deselecting the personal data to release.
Step 20 (Authorization Response): The Wallet Instance provides the Authorization Response to the Relying Party using an HTTP request with the method POST (response mode "direct_post.jwt").
Below is a non-normative example of the Authorization Response:
Below is a non-normative example of the decrypted payload of the JWT contained in the response, before base64url encoding. The vp_token parameter value corresponds to the format used when the DCQL query language is used in the presentation request.
{"state":"3be39b69-6ac1-41aa-921b-3e6c07ddcb03","vp_token":{"personal id data":"eyJhbGciOiJFUzI1NiIs...PT0iXX0","wallet attestation":"eyJhbGciOiJFUzI1NiIs...NTi0XG"}}
Steps 21-25 (RP Checks): The Relying Party verifies the Authorization Response, extracts the Wallet Attestation to establish trust with the Wallet Solution. It then extracts the Digital Credentials and attests trust with the Credentials Issuer and the Wallet Instance's proof of possession of the presented Digital Credentials. Finally, the Relying Party verifies the revocation status of the presented Digital Credentials as described in Digital Credential Revocation and Suspension. If all previous verifications yelded positive result, the Relying Party updates the User session.
Steps 26-27 or 28 (Relying Party Response): The Relying Party provides to the Wallet Instance the response about the presentation, which informs the User.
Upon receiving and validating the Authorization Response at the Response Endpoint, the Relying Party returns to the Wallet Instance a HTTP 200 OK. In particular, in the Same Device Flow, the Relying Party SHOULD also pass the redirect_uri to the Wallet Instance. Upon receiving the redirect_uri, the Wallet Instance MUST perform a redirect to the URL specified by the redirect_uri. This redirect allows the Relying Party to seamlessly resume interaction with the User on the device which initiated the flow. When the response does not contain the redirect_uri parameter, the Wallet Instance is not required to perform any further step. The User should manually close the Wallet Instance and open the user-agent to continue the flow.
The following is a non-normative example of the response in the Same Device Flow.
When the Wallet Instance has provided the presentation to the Relying Party's response_uri endpoint and the User authentication is successful. The Relying Party updates the session cookie allowing the user-agent to access to the protected resource. A redirect URL is provided carrying the location where the user-agent is intended to navigate.
The following is a non-normative example of the response with the redirect_uri from the Relying Party to the user-agent.
The URL parameters contained in the Relying Party Authorization Request, which include the request_uri where the signed Request Object can be downloaded, are described in the table below.
Name
Description
client_id
REQUIRED. Unique identifier of the Relying Party.
request_uri
REQUIRED. The HTTP URL where the Relying Party provides the signed Request Object to the Wallet Instance.
state
RECOMMENDED. A unique identifier for the current transaction generated by the Relying Party. The value SHOULD be opaque to the Wallet Instance.
request_uri_method
OPTIONAL. The HTTP method MUST be set with get or post. The Wallet Instance should use this method to obtain the signed Request Object from the request_uri. If not provided or equal to get, the Wallet Instance SHOULD use the HTTP method get. Otherwise, the Wallet Instance SHOULD provide its metadata within the HTTP POST body encoded in application/x-www-form-urlencoded.
Warning
For security reasons and to prevent endpoint mix-up attacks, the value contained in the request_uri parameter MUST be one of those attested by a trusted third party, such as those provided in the openid_credential_verifier metadata within the request_uris parameter, obtained from the Trust Chain about the Relying Party.
Note
The state parameter in an OAuth request is optional, but it is highly recommended. It is primarily used to prevent Cross-Site Request Forgery (CSRF) attacks by including a unique and unpredictable value that the Relying Party can verify upon receiving the response. Additionally, it helps maintain the state between the request and response, such as session information or other data the Relying Party needs after the authorization process.
The Relying Party SHOULD provide the POST method with its request_uri endpoint allowing the Wallet Instance to inform the Relying Party about its technical capabilities.
This feature can be useful when, for example, the Wallet Instance supports a restricted set of features, supported algorithms or a specific url for its authorization_endpoint, and any other information that it deems necessary to provide to the Relying Party for interoperability.
Warning
The Wallet Instance, when providing its technical capabilities to the
Relying Party, MUST NOT include any User information or other explicit
information regarding the hardware used or usage preferences of its User.
If both the Relying Party and the Wallet Instance support the request_uri_method with HTTP POST, the Wallet Instance capabilities (metadata) MUST be provided using an HTTP request to the request_uri endpoint of the Relying Party, with the method POST and content type set to application/x-www-form-urlencoded.
The request and its parameters are defined in Section number 5 (Authorization Request) of OpenID4VP. Below are the normative details and references about the parameters to be used by the Wallet Instance in the request.
REQUIRED. Object with Credential format identifiers. See OpenID4VP Appendix B.
alg_values_supported
OPTIONAL. Array of cryptographic suites supported. See OpenID4VP Appendix B.
client_id_schemes_supported
RECOMMENDED. Array of Client Identifier schemes. Default is entity_id.
authorization_endpoint
URL of the authorization server's endpoint, see OAUTH2. Using an universal link is preferable for enhanced security and fallback support, custom url schemes can also be used if necessary.
response_types_supported
OPTIONAL. JSON array of OAuth 2.0 "response_type" values. If present it MUST be set to vp_token. Default is vp_token.
response_modes_supported
OPTIONAL. JSON array of OAuth 2.0 "response_mode" values. See JARM.
request_object_signing_alg_values_supported
OPTIONAL. See OpenID Connect Discovery.
Note
The wallet_nonce parameter is RECOMMENDED for Wallet Instances that want to prevent reply of their http requests to the Relying Parties.
When present, the Relying Party MUST evaluate it.
Note
For the authorization_endpoint the use of universal links are preferred over custom url-schemes because, when properly configured using Assetlinks JSON for Android and Apple App Site Association for iOS, they provide enhanced security by reducing the risk of URL hijacking.
Furthermore, universal links offer fallback mechanisms, allowing the flow to continue seamlessly in a browser even if the Wallet Instance is not installed, ensuring a smoother User experience. To ensure interoperability, support custom url-schemes is also RECOMMENDED according to OpenID4VC High Assurance Interoperability Profile (HAIP) OPENID4VC-HAIP, and in particular using the custom url haip://.
The Relying Party issues the signed Request Object using the content type set to application/oauth-authz-req+jwt.
The JWT header parameters are described below:
Name
Description
alg
Algorithm used to sign the JWT, according to [RFC 7516#section-4.1.1]. It MUST be one of the supported algorithms in Section Cryptographic Algorithms and MUST NOT be set to none or to a symmetric algorithm (MAC) identifier.
typ
Media Type of the JWT, as defined in [RFC 7519] and [RFC 9101]. It SHOULD be set to the value oauth-authz-req+jwt.
kid
Key ID of the public key needed to verify the JWT signature, as defined in [RFC 7517]. REQUIRED when trust_chain is used.
trust_chain
Sequence of Entity Statements that composes the Trust Chain related to the Relying Party, as defined in OID-FED Section 4.3 Trust Chain Header Parameter.
The JWT payload parameters are described herein:
Name
Description
client_id
Unique Identifier of the Relying Party.
response_mode
It MUST be set to direct_post.jwt.
dcql_query
Object representing a request for a presentation of Credentials, according to the DCQL query language defined in Section 6 of OpenID4VP.
response_type
It MUST be set to vp_token.
wallet_nonce
String value used to mitigate replay attacks of the response, as defined in Section 5.11 (Request URI Method) of OpenID4VP. It MUST be present if previously provided by Wallet Instance.
response_uri
The Response URI to which the Wallet Instance MUST send the Authorization Response using an HTTP request using the method POST.
nonce
Fresh cryptographically random number with sufficient entropy, which length MUST be at least 32 digits.
state
Unique identifier of the Authorization Request.
iss
The entity that has issued the JWT. It will be populated with the Relying Party client id.
iat
Unix Timestamp, representing the time at which the JWT was issued.
exp
Unix Timestamp, representing the expiration time on or after which the JWT MUST NOT be valid anymore.
request_uri_method
String determining the HTTP method to be used with the request_uri endpoint to provide the Wallet Instance metadata to the Relying Party. The value is case-insensitive and can be set to: get or post. The GET method, as defined in [@RFC9101], involves the Wallet Instance sending a GET request to retrieve a Request Object. The POST method involves the Wallet Instance requesting the creation of a new Request Object by sending an HTTP POST request, with its metadata, to the request URI of the Relying Party.
Warning
For security reasons and to prevent endpoint mix-up attacks, the value contained in the response_uri parameter MUST be one of those attested by a trusted third party, such as those provided in the openid_credential_verifier metadata within the response_uris parameter, obtained from the Trust Chain about the Relying Party.
Note
The following parameters, even if defined in [OID4VP], are not mentioned in the previous non-normative example, since their usage is conditional and may change in future release of this documentation.
presentation_definition: JSON object according to Presentation Exchange. This parameter MUST not be present when presentation_definition_uri or scope are present.
presentation_definition_uri: Not supported. String containing an HTTPS URL pointing to a resource where a Presentation Definition JSON object can be retrieved. This parameter MUST be present when presentation_definition parameter or a scope value representing a Presentation Definition is not present.
client_metadata: A JSON object containing the Relying Party metadata values. If the client_metadata parameter is present, the Wallet Instance MUST ignore it and consider the client metadata obtained through the OpenID Federation Trust Chain.
When the Relying Party encounters errors while issuing the Request Object from the request_uri endpoint, it MUST return an error response with application/json as the content type and MUST include the following parameters:
error: The error code.
error_description: Text in human-readable form providing further details to clarify the nature of the error encountered.
The following table lists the HTTP Status Codes and related error codes that MUST be supported for the error response:
Status Code
Error Code
Description
500InternalServerError
server_error
The request cannot be fulfilled because the Request URI Endpoint encountered an internal problem. (RFC 6749#section-4.1.2.1).
503ServiceUnavailable
temporarily_unavailable
The request cannot be fulfilled because the Request URI Endpoint is temporarily unavailable (e.g., due to maintenance or overload). (RFC 6749#section-4.1.2.1).
The following is an example of an error response from request_uri endpoint:
HTTP/1.1500Internal Server ErrorContent-Type:application/json{"error":"server_error","error_description":"The Request Object cannot be retrieved due to an internal server error."}
Upon receiving an error response, the Wallet Instance SHOULD inform the User of the error condition in an appropriate manner. The Wallet Instance SHOULD log the error and MAY attempt to recover from certain errors if feasible. For example, if the error is server_error, the Wallet Instance SHOULD prompt the User to re-enter or scan a new QR code, if applicable.
After obtaining the User authorization and consent for the presentation of the Digital Credentials, the Wallet Instance sends the Authorization Response to the Relying Party response_uri endpoint using an HTTP request with the method POST, the content SHOULD be encrypted according OpenID4VP Section 7.3, using the Relying Party public key.
Note
Why the response is encrypted?
The response sent from the Wallet Instance to the Relying Party is encrypted to prevent a malicious agent from gaining access to the plaintext information transmitted within the Relying Party's network. This is only possible if the network environment of the Relying Party employs TLS termination. Such technique employs a termination proxy that acts as an intermediary between the client and the webserver and handles all TLS-related operations. In this manner, the proxy deciphers the transmission's content and either forwards it in plaintext or by negotiates an internal TLS session with the actual webserver's intended target. In the first scenario, any malicious actor within the network segment could intercept the transmitted data and obtain sensitive information, such as an unencrypted response, by sniffing the transmitted data.
Where the following parameters are used:
Name
Description
vp_token
There MUST be at least two signed presentations in this Array:
The requested Digital Credential (one or more, in format of SD-JWT VC)
The Wallet Attestation (in SD-JWT VC format)
When presentation_definition is used, the vp_token value is a JSON Array containing the Verifiable Presentation(s) and the presentation_submission parameter MUST be also present within the response.
When the DCQL query language is used, the vp_token format is a JSON Object which keys corresponds to the requested credential ids in the dcql_query used in the request, and the values to each presented Digital Credential.
state
Unique identifier provided by the Relying Party within the Authorization Request.
SD-JWT defines how a Holder can present a Digital Credential to a Relying Party, proving the legitimate possession of the Digital Credential. To do this, the Holder MUST include the KB-JWT in the SD-JWT by appending the KB-JWT at the end of the SD-JWT, as represented in the example below
To validate the signature on the Key Binding JWT, the Relying Party MUST use the key material included in the Issuer-Signed-JWT. The Key Binding JWT (KB-JWT) signature validation MUST use the public key included in the SD-JWT, using the cnf parameter contained in the Issuer-Signed-JWT.
When an SD-JWT is presented, its KB-JWT MUST contain the following parameters in the JWT header:
Claim
Description
typ
REQUIRED. MUST be kb+jwt, which explicitly types the Key Binding JWT as recommended in Section 3.11 of [RFC8725].
alg
REQUIRED. Signature Algorithm using one of the specified in the section Cryptographic Algorithms.
When an SD-JWT is presented, the KB-JWT signature MUST be verified by the same public key included in the SD-JWT within the cnf parameter. The KB-JWT MUST contain the following parameters in the JWT payload:
Claim
Description
iat
REQUIRED. The value of this claim MUST be the time at which the Key Binding JWT was issued, using the syntax defined in [RFC7519].
aud
REQUIRED. The intended receiver of the Key Binding JWT. The value of this parameter MUST match the Relying Party unique entity identifier.
nonce
REQUIRED. Ensures the freshness of the signature. The value type of this claim MUST be a string. The value MUST match with the one provided in the request object.
sd_hash
REQUIRED. The base64url-encoded hash digest over the Issuer-signed JWT and the selected disclosures.
There are cases where the Wallet Instance cannot validate the Request Object or the Request Object results invalid. This error occurs if the Request Object is successfully fetched from the url provided in the parameter request_uri but fails the validation checks. This could be due to incorrect signatures, malformed claims, or other validation failures, such as the revocation of the Relying Party.
If the Wallet Instance encounters any such errors during the evaluation of the Authorization Request, it MUST notify the Relying Party by sending an Authorization Error Response.
The Wallet Instance sends the Authorization Error Response to the Relying Party response_uri endpoint using an HTTP POST request.
The Authorization Error Response MUST be encoded in the request body using the format defined by the application/x-www-form-urlencoded content type.
Below is a non-normative example of an Authorization Error Response.
The current OpenID4VP specification outlines various error responses that a Wallet Instance may return to the Relying Party (Verifier) in case of faulty requests. For privacy enhancement, Wallet Instances SHOULD NOT notify the Relying Party of faulty requests in certain scenarios. This is to prevent any potential misuse of error responses that could lead to gather informations that could be exploited.
In the following table are listed error codes and descriptions that are supported for the Authorization Error Response:
Error Code
Description
invalid_request_object
The Request Object contains invalid parameters or is otherwise malformed. RFC 9101
invalid_request_uri
The request_uri in the authorization request returns an error, contains invalid data, or is otherwise malformed. RFC 9101
vp_formats_not_supported
The Wallet Instance does not support any of the vp formats required by the Relying Party. OpenID4VP
invalid_request
The Wallet Instance does not support any of the signing algorithms required by the Relying Party. OpenID4VP
access_denied
The Wallet did not have the requested credential, the User did not consent, or the Wallet failed to authenticate the User. OpenID4VP
invalid_client
The Relying Party cannot be authorized due to trust validation failures or is not a valid participant of the federation. OID-FED
As defined in Section 7.2. (Response Mode "direct_post") of the OpenID4VP specification, if the Response URI has successfully processed the Authorization Response or Authorization Error Response, it MUST respond with an HTTP status code of 200 with Content-Type of application/json and a JSON object in the response body.
In the Same Device Flow, the Relying Party SHOULD add the redirect_uri parameter to the JSON object in the response body. Upon receiving the redirect_uri, the the Wallet Instance MUST perform a redirect to the URL specified by the redirect_uri.
This redirect allows the Relying Party to seamlessly resume interaction with the User on the device which initiated the flow, after the Wallet Instance has transmitted the Authorization Response to the designated response_uri.
The Relying Party MUST include a response code within the redirect_uri. The response code is a fresh, cryptographically random number used to ensure only the receiver of the redirect can fetch and process the Authorization Response. The number could be added as a path component, as a parameter or as a fragment to the URL. It is RECOMMENDED to use a cryptographic random value of 128 bits or more at the time of the writing of this specification.
Even if an adversary manages to steal the random value used in the request to the status endpoint, their user-agent would be rejected due to the missing cookie in the request.
Warning
For security reasons and to prevent endpoint mix-up attacks, the value contained in the redirect_uri parameter MUST be one of those attested by a trusted third party, such as those provided in the openid_credential_verifier metadata within the redirect_uris parameter, obtained from the Trust Chain about the Relying Party.
If any validation check, performed by the Relying Party on the Authorization Response from the Wallet Instance, fails; the Response URI endpoint MUST return an error response. The structure of this error response should be determined by the specific nature of the error encountered. The response MUST use application/json as the content type and MUST include the following parameters:
error: The error code.
error_description: Text in human-readable form providing further details to clarify the nature of the error encountered.
The following table lists the HTTP Status Codes and related error codes that MUST be supported for the error response:
Status Code
Error Code
Description
400BadRequest
invalid_request
The response cannot be processed because it is missing required parameters, contains invalid parameters or is otherwise malformed.
400BadRequest
invalid_request
The Credentials presented are malformed, invalid or revoked.
400BadRequest
invalid_request
The credential presentation, contained in the vp_token object, is malformed, doesn't have the required parameters or is incorrectly formatted.
400BadRequest
invalid_request
The "sd-jwt" returned is malformed, missing required parameters or incorrectly formatted.
403Forbidden
invalid_request
The signature of the KB-JWT is invalid or does not match the associated public key (JWK) referenced in the Issuer signed SD-JWT.
403Forbidden
invalid_request
The nonce value provided is incorrect or otherwise malformed.
403Forbidden
invalid_request
The signature of the Wallet Attestation is not valid or trust cannot be established with its Issuer.
403Forbidden
invalid_request
Trust could not be established with the Credential Issuer.
500InternalServerError
server_error
The request cannot be fulfilled because the Response URI Endpoint encountered an internal problem.
503ServiceUnavailable
temporarily_unavailable
The request cannot be fulfilled because the Response URI Endpoint is temporarily unavailable (e.g., due to maintenance or overload).
Below there are two examples of HTTP responses using application/json that include both the error and error_description members:
HTTP/1.1403ForbiddenContent-Type:application/json{"error":"invalid_request","error_description":"Trust cannot be established with the issuer: https://issuer.example.com"}
HTTP/1.1400Bad RequestContent-Type:application/json{"error":"invalid_request","error_description":"The vp_token is malformed, missing required parameters or incorrectly formatted"}
This specification introduces the Relying Party Status Endpoint for implementations that choose to use it. This endpoint is an internal security feature of the implementation and is not required for interoperability.
Whether the flow is Same Device or Cross Device, the user-agent needs to check the session status at the endpoint made available by the Relying Party (status endpoint).
This check MAY be implemented in the form of JavaScript code, within the page that shows the QRCode or the href button pointing to the request URL.
The JavaScript code makes the user-agent check the status endpoint using either a polling strategy (in seconds) or a push strategy (e.g., WebSocket).
Since the HTML page and the status endpoint are implemented by the Relying Party, the implementation details of this solution are the responsibility of the Relying Party, as this is related to the Relying Party's internal API. However, the text below describes an example implementation.
The Relying Party binds the request of the user-agent, with a session cookie marked as Secure and HttpOnly, with the issued request.
The request url SHOULD include a parameter with a random value. The HTTP response returned by this status endpoint MAY contain the HTTP status codes listed below:
201 Created. The signed Request Object was issued by the Relying Party that waits to be downloaded by the Wallet Instance at the request_uri endpoint.
202 Accepted. This response is given when the signed Request Object was obtained by the Wallet Instance.
200 OK. The Wallet Instance has provided the presentation to the Relying Party's response_uri endpoint and the User authentication is successful. The Relying Party updates the session cookie allowing the user-agent to access to the protected resource. A redirect URL is provided carrying the location where the user-agent is intended to navigate.
If instead any validation check performed by the Relying Party fails, the QRCode page SHOULD be updated with an error message. Moreover, the status endpoint MUST return an error response, whose structure depends on the nature of the error. The response MUST use application/json as the content type and MUST include the following parameters:
error: The error code.
error_description: Text in human-readable form providing further details to clarify the nature of the error encountered.
The following table lists the HTTP Status Codes and related error codes that MUST be supported for the error response:
Status Code
Error Code
Description
401Unauthorized
authentication_failed
The Wallet Instance or its User have rejected the request, the request is expired, or other errors prevented the authentication.
403Forbidden
invalid_session
Either the session id provided in the request is invalid.
The redirect_uri value MUST be used with an HTTP method GET by the user-agent to redirect the User to a specific Relying Party's endpoint in order to complete the process.
When the user-agent is redirected to the Redirect URI provided by the Relying Party, several errors may occur that prevent the successful completion of the process. These errors are critical as they directly impact the User experience by hindering the seamless flow of information between the Wallet Instance and the Relying Party. Handling these errors requires clear communication to the User within the returned navigation web page. Relying Party MUST implement the error handling and validation mechanisms for Redirect URIs defined in this specification. Below are potential errors related to the Redirect URI, the error response MUST use application/json as the content type and MUST include the following parameters:
error: The error code.
error_description: Text in human-readable form providing further details to clarify the nature of the error encountered.
The following table lists the HTTP Status Codes and related error codes that MUST be supported for the error response:
Status Code
Error Code
Description
403Forbidden
invalid_request
The Redirect URI provided by the Relying Party does not match any of the URIs linked with the User session. (RFC 6749#section-4.1.2.1)
This section describes how a Relying Party Instance requests the presentation of an mdoc-CBOR Credential to a Wallet Instance according to the ISO 18013-5 Specification.
The high-level presentation phase is structured into three broad sub-phases as depicted in the following figure:
Fig. 18 High-Level Presentation Flow in proximity¶
The sub-phases are described below:
1. Device Engagement: This subphase begins when the User is prompted to disclose certain attributes from the mdoc(s). The objective of this subphase is to establish a secure communication channel between the Wallet Instance and the Relying Party Instance, so that the mdoc requests and responses can be exchanged during the communication subphase.
The messages exchanged in this subphase are transmitted through short-range technologies to limit the possibility of interception and eavesdropping.
2. Session establishment: During the session establishment phase, the Relying Party Instance sets up a secure connection. All data transmitted over this connection is encrypted using a session key, which is known to both the Wallet Instance and the Relying Party Instance at this stage.
The established session MAY be terminated based on the conditions as detailed in [ISO18013-5 #9.1.1.4].
3. Communication - Device Retrieval: The Relying Party Instance encrypts the mdoc request with the appropriate session key and sends it to the Wallet Instance together with its public key in a session establishment message. The mdoc uses the data from the session establishment message to derive the session key and decrypt the mdoc request.
During the communication subphase, the Relying Party Instance has the option to request information from the Wallet Instance using mdoc requests and responses. The primary mode of communication is the secure channel established during the session setup. The Wallet Instance encrypts the mdoc response using the session key and transmits it to the mobile Relying Party via a session data message.
Relying Party and Wallet Instances registered in the IT-Wallet ecosystem MUST support at least:
Supervised Device Retrieval flow where a human Relying Party is overseeing the verification process in person, in contrast with unsupervised flow where verification might happen through automated systems without human oversight.
Device Engagement based on QR Code.
RP Instance Authentication following the mechanisms defined in the ISO18013-5 for the reader authentication.
Device Retrieval mechanism based on Bluetooth Low Energy (BLE) for the communication sub-phase. Server Retrieval mechanism MUST NOT be supported.
Domestic Document Type and Namespaces defined in this technical specification in addition to those already defined in the ISO18013-5 for the mDL (see mdoc-CBOR Credential Format for more details).
Wallet Instance validation through the Wallet Attestation.
The following figure illustrates the low-level flow compliant with ISO 18013-5 for proximity flow.
Step 1: The User opens the Wallet Instance initiating the process.
Step 2: The User authenticates itself to the Wallet Instance. This can be done by the Wallet Instance or a Wallet Secure Cryptographic Application (WSCA). It is a prerequisite for accessing sensitive data and presenting attributes.
Step 3: The User selects the proximity presentation functionality.
Step 4: [Optional] If the initial authentication in Step 2 was not done through WSCA, a separate authentication via WSCA MAY be required.
Step 5: The Wallet Instance generates a new ephemeral Elliptic Curve key pair for secure communication. The public key (EDeviceKey.Pub) will be used for session encryption. This is part of the device engagement process.
Step 6: The Wallet Instance presents a QR Code to the Relying Party Instance. This QR code contains the DeviceEngagement data, which includes the EDeviceKey.Pub and information about supported cipher suites.
Below is a non-normative example using the diagnostic notation of a CBOR-encoded DeviceEngagement that utilizes QR for device engagement and Bluetooth Low Energy (BLE) for data retrieval.
{
0: "1.1", % Version (Updated to 1.1 because Capabilities and OriginInfos are present)
1: % Security
[
1, % defines the cipher suite , which contains only EC curves
24(<< % embedded CBOR data item
{
1: 2, % kty:EC2 (Elliptic curves with x and y coordinate pairs)
-1: 1, % crv:p256
-2:h'5A88D182BCE5F42EFA59943F33359D2E8A968FF289D93E5FA444B624343167FE', % x-coordinate
-3:h'B16E8CF858DDC7690407BA61D4C338237A8CFCF3DE6AA672FC60A557AA32FC67' % y-coordinate
}
>>)
],
2: % DeviceRetrievalMethods (Device engagement using QR code with BLE for retrieval)
[
[
2, % BLE
1, % Version
{ % BLE options
0: false, % no support for mdoc peripheral server mode
1: true, % support for mdoc central client mode
11: h'45EFEF742B2C4837A9A3B0E1D05A6917' % UUID of mdoc client central mode
}
]
],
5: % OriginInfos (Required because Capabilities is present)
[],
6: % Capabilities (Defines supported features)
{
2: false, % HandoverSessionEstablishmentSupport (Supports negotiated handover)
3: true % ReaderAuthAllSupport (Supports reader authentication)
}
}
Step 7: The verifier uses its Relying Party Instance to scan the QR code and retrieve the DeviceEngagement data from the mdoc.
Step 8: The Relying Party Instance generates its ephemeral key pair (EReaderKey.Priv, EReaderKey.Pub). The private key (EReaderKey.Priv) MUST be kept secret, and the public key (EReaderKey.Pub) MUST be used in establishing the session.
Step 9: The Wallet Instance and Relying Party Instance independently MUST derive the session keys using their private ephemeral key and the other party's public ephemeral key through a key agreement protocol. This ensures session encryption. In this particular step, the Relying Party Instance MUST compute its session key.
Step 10: The RP Instance MUST prepare a SessionEstablishment message. This message MUST be signed by the Relying Party Instance (mdoc reader authentication as specified in [ISO18013-5 #9.1.4]) and encrypted using the session keys derived in the previous step. The SessionEstablishment message MUST include the EReaderKey.Pub and a request for specific attribute(s).
Below is a non-normative example using the diagnostic notation of a CBOR-encoded SessionEstablishment that contains the mdoc request of a Wallet Attestation along with an mDL Digital Credential.
Step 11: The Relying Party Instance MUST transmit the encrypted and signed SessionEstablishment message to the Wallet Instance over a secure BLE connection that was established based on the device engagement information.
Step 12: The Wallet Instance MUST compute the session key, as described in Step 9.
Step 13: Upon receiving the SessionEstablishment message, the Wallet Instance MUST decrypt it using the shared session key and MUST verify the Relying Party Instance's signature (mdoc reader authentication as specified in [ISO18013-5 #9.1.1.4]) to ensure its authenticity.
Step 14: The Wallet Instance MUST decrypt the attribute request and MUST prompt the User for their consent to release the requested attributes. It MUST also display the contents of the Relying Party's registration certificate to ensure transparency about the requested data and its registered purpose.
Step 15: The User reviews the request and the Relying Party's registration information and then approves the presentation of the requested attributes.
Step 16: After receiving User approval, the Wallet Instance MUST retrieve the requested mdoc Digital Credentials. It then MUST prepare a SessionData message containing these Digital Credentials, and it MUST sign the required authentication data (as part of the mdoc authentication process, as specified in [ISO18013-5 #9.1.3]). It MUST encrypt it using the established session keys before transmitting it to the Relying Party Instance over the secure BLE channel. The signing ensures device binding and data integrity. The mdoc response MUST be encoded in CBOR, with its structure outlined in [ISO18013-5 #8.3.2.1.2.2].
Below is a non-normative example using the diagnostic notation of a CBOR-encoded SessionData that contains the mdoc response of a Wallet Attestation and an mDL.
Step 17: The Relying Party Instance receives the SessionData, then it MUST decrypt it, and it MUST verify the Wallet Instance's signature to ensure the data's integrity and that it originates from the expected device (device binding). It also MUST check the validity of the mdoc, including its Issuer's signature. In case of long-lived Digital Credentials, it SHOULD also check the revocation status using TOKEN-STATUS-LIST.
Step 18: Once the data exchange is complete, either party can terminate the session. If BLE is used, this can involve sending a status code for session termination or the “End” command. In this scenario, the GATT Client (Relying Party Instance) MUST unsubscribe from characteristics and disconnect from the GATT server (Wallet Instance).
Final Consideration: The presentation flow focused on the technical data exchange in proximity settings. It is crucial to recognise that supervised proximity flows involving a human verifier play a vital role in many use cases (e.g., age verification at a store, identity check by law enforcement). The human element adds a layer of identity verification through visual inspection and comparison, contributing to User Binding and overall authentication assurance aspects not fully captured in a purely technical presentation flow.
Note
During proximity presentation the Wallet Instance might not be able to fetch a fresh Wallet Attestation, in this case, the Wallet Instance SHOULD send the latest version of the Wallet Attestation. It is left up to the Relying Party to determine whether a presentation with a valid but expired Wallet Attestation is valid or not.
The Device Engagement structure MUST be CBOR encoded and have at least the following components:
Component
Description
Version
(tstr). Version of the device engagement structure.
Security
(array). Contains two mandatory values:
(int). Cipher suite identifier. See Table 22 of ISO18013-5.
(bstr). Public ephemeral key generated by the Wallet Instance, used by the Relying Party Instance to derive the Session Key. The key MUST be of a type allowed by the selected cipher suite.
BleOptions
(map). Provides options for the BLE connection, such as Peripheral Server or Central Client mode, and the device UUID.
Only Central Client Mode MUST be supported by this implementation profile.
Capabilities
(map). Declares optional capabilities supported by the mdoc, that are:
HandoverSessionEstablishmentSupport(bool). If present, it MUST be set to true. Indicates support for receiving the SessionEstablishment message during Negotiated Handover, as defined in [ISO18013-5 #8.2.2.4].
ReaderAuthAllSupport(bool). If present, it MUST be set to true. Indicates support for receiving the ReaderAuthAll structure in the mdoc request, as defined in [ISO18013-5 #8.3.2.1.2.1].
OriginInfos
(array). Describes the interface used to receive and deliver the engagement structure.
When used in flows defined in [ISO18013-5 #6.3.2.1], OriginInfos MAY be an empty array.
The messages in the mdoc Request MUST be encoded using CBOR. The resulting CBOR byte string for the mdoc Request MUST be encrypted with the Session Key obtained after the Device Engagement phase and MUST be transmitted using the BLE protocol.
Each mdoc Request MUST be compliant with the following structure, and MUST include the following components, unless otherwise specified:
Component
Description
version
(tstr). Version of the mdoc Request structure. Enables compatibility management across different versions or implementation profiles.
nameSpaces(map). A map of namespace identifiers to requested DataElements.
Each entry in DataElements includes:
DataElementIdentifier(tstr). The identifier of the requested data element.
IntentToRetain(bool). Indicates whether the Relying Party intends to retain the value of the data element.
readerAuth(COSE_Sign1, CONDITIONAL). Used to authenticate the the Relying Party Instance for each DocRequest. The signature is computed over ReaderAuthentication data, as defined in [ISO18013-5 #9.1.4].
This component MUST be present only if readerAuthAll is not used.
readerAuthAll
(COSE_Sign1, CONDITIONAL). Used to authenticate the Relying Party once for all DocRequest`s. The signature is computed over `ReaderAuthenticationAll data, as defined in [ISO18013-5 #9.1.4].
This component MUST be present only if ReaderAuthAllSupport is set to true in the DeviceEngagement structure, and individual readerAuth fields are not used.
The messages in the mdoc Response MUST be encoded using CBOR and MUST be encrypted with the Session Key obtained after the Device Engagement phase.
Each mdoc Response MUST be compliant with the following structure, and MUST include the following components, unless otherwise specified:
Component
Description
version
(tstr). Version of the mdoc Response structure. Enables tracking changes and maintaining compatibility across versions of the standard or implementation profiles.
documents
(array of Documents, OPTIONAL). CBOR-encoded collection of documents returned in response to the request. Each document includes issuerSigned and deviceSigned components, and follows the structure defined in the below table.
documentErrors
(map, OPTIONAL). A map of error codes for unreturned documents, as defined in [ISO18013-5 #8.3.2.1.2.3]. Each key is a docType, and each value is an ErrorCode (int) indicating the reason why the document was not returned.
status
(uint). Status code indicating the outcome of the request. For example, "status": 0 means successful processing. For details, see Table 8 (ResponseStatus) of [ISO18013-5 #8.3.2.1.2].
Each document in documents MUST be compliant with the following structure, and it MUST include the following components, unless otherwise specified:
Component
Description
docType
(tstr). Document type identifier. For example, for an mDL, the value MUST be org.iso.18013.5.1.mDL.
issuerSigned
(bstr). Contains the IssuerNameSpaces structure, which includes data elements signed by the Issuer, and the issuerAuth structure, which ensures their authenticity and integrity using the Mobile Security Object (MSO). See mdoc-CBOR Credential Format.
deviceSigned
(bstr). Contains the DeviceNameSpaces structure (data elements signed by the Wallet Instance), and the deviceAuth structure, which includes the authentication data signed by the Wallet Instance. See the table below for details.
errors
(map, OPTIONAL). A map of error codes for each unreturned data element grouped by namespace. Each key represents a namespace, and each value is a map of data element identifiers to corresponding error codes. See [ISO18013-5 #8.3.2.1.2.3] for details on the errors structure.
A deviceSigned data structure MUST be compliant with the following structure, and MUST include the following components:
Component
Description
nameSpaces
(bstr). Contains the DeviceNameSpaces structure. It MAY be an empty structure. DeviceNameSpaces maps namespace identifiers to a set of data elements signed by the Wallet Instance.
Each namespace contains one or more DeviceSignedItem, where each item includes:
DataItemName(tstr). The identifier of the data element.
DataItemValue(any). The value of the data element.
deviceAuth
(COSE_Sign1). Contains the DeviceAuth structure, which MUST include the deviceSignature for the Wallet Instance authentication. The signature is computed over the DeviceAuthentication data, which binds the returned elements to the session and the request. See [ISO18013-5 #9.1.3] for details on the authentication structure.
The session MUST be terminated if at least one of the following conditions occur:
after a time-out of no activity of receiving or sending session establishment or session data messages occurs. The time-out for no activity implemented by the Wallet Instance and the Relying Party Instance SHOULD be no less than 300 seconds;
when the Wallet Instance does not accept any more requests;
when the Relying Party Instance does not send any further requests.
If the Wallet Instance and the Relying Party Instance does not send or receive any further requests, the session termination MUST be initiated as follows:
send the status code for session termination, or
dispatch the "End" command as outlined in [ISO18013-5 #8.3.3.1.1.5].
When a session is terminated, the Wallet Instance and the Relying Party Instance MUST perform at least the following actions:
destruction of session keys and related ephemeral key material;
closure of the communication channel used for data retrieval.