Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relying Party Remote Presentation alignments with standards #400

Merged
merged 19 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
1f5b874
fix!: alignments according to breaking changes introduced by openid4v…
peppelinux Dec 28, 2023
0aca337
Merge branch 'versione-corrente' of https://github.com/italia/eidas-i…
peppelinux Jan 4, 2024
4da2a73
Merge branch 'versione-corrente' of https://github.com/italia/eidas-i…
peppelinux Feb 27, 2024
70ae3cd
Merge branch 'versione-corrente' of https://github.com/italia/eidas-i…
peppelinux Mar 1, 2024
46db71b
Merge branch 'versione-corrente' of https://github.com/italia/eidas-i…
peppelinux Mar 18, 2024
765afc3
Merge branch 'versione-corrente' of https://github.com/italia/eidas-i…
peppelinux Mar 28, 2024
59ff263
Merge branch 'versione-corrente' of https://github.com/italia/eidas-i…
peppelinux Apr 13, 2024
f985779
Merge branch 'versione-corrente' of https://github.com/italia/eidas-i…
peppelinux May 13, 2024
026deca
Merge branch 'versione-corrente' of https://github.com/italia/eidas-i…
peppelinux Jul 18, 2024
00a5a1a
Merge branch 'versione-corrente' of https://github.com/italia/eidas-i…
peppelinux Sep 6, 2024
6160f8a
improved check in RP. Fixes https://github.com/italia/eudi-wallet-it-…
peppelinux Sep 6, 2024
4ab39d3
breaking-change: universal links and haip are not used, openid: is us…
peppelinux Sep 6, 2024
2ae9d8c
fix: RP crossdevice flow without redirect_uri. Fixes https://github.c…
peppelinux Sep 6, 2024
73daa18
fix: presentation_submission further clarifications. Removed client_m…
peppelinux Sep 6, 2024
53db21e
Apply suggestions from code review
peppelinux Sep 6, 2024
d213939
Apply suggestions from code review
peppelinux Sep 9, 2024
560da6e
fix: clarification about client metadata with the presence of entity_id
peppelinux Sep 11, 2024
e79a1e7
Revert "breaking-change: universal links and haip are not used, openi…
peppelinux Sep 18, 2024
8b84ee8
Apply suggestions from code review
peppelinux Sep 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions docs/en/remote-flow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,19 @@ A High-Level description of the remote flow, from the User's perspective, is giv
2. the Wallet Instance extracts from the payload the following parameters: ``client_id``, ``request_uri``, ``state``, ``request_uri_method`` and ``client_id_scheme``;
3. If the ``client_id_scheme`` is provided and set with the value ``entity_id``, the Wallet Instance MUST collect and validate the OpenID Federation Trust Chain related to the Relying Party. If the ``client_id_scheme`` is either not provided or is assigned a value different from ``entity_id``, the Wallet Instance MUST establish the trust by utilizing the ``client_id`` or an alternative ``client_id_scheme`` value. This alternative value MUST enable the Wallet Instance to establish trust with the Relying Party, ensuring compliance with the assurance levels mandated by the trust framework;
4. 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 and obtain the signed Request Object. 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;
5. the Wallet Instance verifies the signature of the signed Request Object, using the public key obtained with the trust chain, and that its issuer matches the ``client_id`` obtained at the step number 2;
6. the Wallet Instance evaluates the requested Digital Credentials and checks the elegibility of the Relying Party in asking these by applying the policies related to that specific Relying Party, obtained with the trust chain;
7. the Wallet Instance asks User disclosure and consent;
8. the Wallet Instance presents the requested information to the Relying Party along with the Wallet Attestation. The Relying Party validates the presented Credentials checking the trust with their Issuers, and validates the Wallet Attestation by also checking that the Wallet Provider is trusted;
9. the Wallet Instance informs the User about the successfull authentication with the Relying Party, the User continues the navigation.
5. the Wallet Instance verifies the signature of the signed Request Object, using the public key identifier within the Request Object JWT header parameter to select the correct public key obtained within Trust Chain related to the RP;
6. the Wallet Instance verifies that the ``client_id`` contained in the Request Object issuer (RP) matches with the one obtained at the step number 2 and with the ``sub`` parameter contained in the RP's Entity Configuration within the Trust Chain;
7. the Wallet Instance evaluates the requested Digital Credentials and checks the elegibility of the Relying Party in asking these by applying the policies related to that specific Relying Party, obtained with the trust chain;
8. the Wallet Instance asks User disclosure and consent;
9. the Wallet Instance presents the requested information to the Relying Party along with the Wallet Attestation. The Relying Party validates the presented Credentials checking the trust with their Issuers, and validates the Wallet Attestation by also checking that the Wallet Provider is trusted;
10. the Wallet Instance informs the User about the successfull authentication with the Relying Party, the User continues the navigation.

Below a sequence diagram that summarizes the interactions between all the involved parties.

.. figure:: ../../images/cross_device_auth_seq_diagram.svg
:figwidth: 100%
:align: center
:target: https://www.plantuml.com/plantuml/svg/ZLLRRnit4ttdhpZGz_3PXkCcwPi05t5SDvUqjMefoKCI21Ht9B6co2qlgxX5_tjdIUo2SWIqXc5Or5pEd3apyo94wMFQ6I5JT3RjLkI545SgEe_9-q1-0XcGX5Yvh-NX_m4_KgSLXGd-zxFUREDBaqYq74ShtKeRCVaeZQ68DvR3MqKvnlxG976e9t93DfOCKf1jm5aEpUx8F6YxmOmV7x9bHq985NKd8p6mX2S_iFSK7sc5EVaU6Qpiz4P6xMnbAaL3jQFiFJkQuex-I1GYPjv5Kf4QVWakUSMPBY_vcGB3pE4msyf0kBmSu_PuEXf2NNlgtoJEpW9xqDaPEidqVBOhbxY-w30M7g6SkzT7t7q1j4nUmmzGEXeg_UtksZM4spkyNYnc3BRHdd7ZvFkdpq-nrt7xsIgZESDID-Trj7DaLEVuL3qkTnIthlc2JwFJCgWjxUXBnLZcdNystgMMWRemw03EceT29z8KywtR8svfWDbohGVCoqVjOxVz5BSjsUpsI3kGRNiEuvGqa8aDB8kZjBOEEiPadUrHGiwLj8m2FOpnyUPhz6oRKx7I91TFFc3jtIw_3VPa6p4wKTz43XuGVGenSvojHyQEaIUaYT1hVCirT42W4WUps_b20C1-a47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DQp7VnQe3e7pzttwIk_Ayex_Muwtit0yFtA6me7aQ3SQwc0RDhXYntTbN6nZsObEzGPdWXZxUuO0iKfHIFGfdOQ2ow8EAVBe8Qlyh0ngVetz5_OgAy0


Remote Protocol Flow
Expand All @@ -60,7 +61,7 @@ The details of each step shown in the previous picture are described in the tabl
* - **13**
- When the Wallet Instance capabilities discovery is not supported by RP, the Wallet Instance request the signed Request Object using the HTTP method GET.
* - **14**
- The Wallet Instance obtains the signed Request Object.
- The RP issues the Request Object signin it using one of its cryptographic private keys, where their public parts have been published within its Entity Configuration (`metadata.openid_wallet_relying_party.jwks`). The Wallet Instance obtains the signed Request Object.
peppelinux marked this conversation as resolved.
Show resolved Hide resolved
peppelinux marked this conversation as resolved.
Show resolved Hide resolved
* - **15**, **16**, **17**
- The Request Object JWS is verified by the Wallet Instance. The Wallet Instance processes the Relying Party metadata and applies the policies related to the Relying Party, attesting whose Digital Credentials and User data the Relying Party is granted to request.
* - **18**, **19**
Expand All @@ -69,7 +70,7 @@ The details of each step shown in the previous picture are described in the tabl
- The Wallet Instance provides the Authorization Response to the Relying Party using an HTTP request with the method POST (response mode "direct_post.jwt").
* - **21**, **22**, **23**, **24**, **25**
- The Relying Party verifies the Authorization Response, extracts the Wallet Attestation to establish the trust with the Wallet Solution. The Relying Party extracts the Digital Credentials and attests the trust to the Credentials Issuer and the proof of possession of the Wallet Instance about the presented Digital Credentials. Finally, the Relying Party verifies the revocation status of the presented Digital Credentials.
* - **26**
* - **26** (Same Device Flow only)
- The Relying Party provides to the Wallet Instance a redirect URI with a response code to be used by the Wallet Instance to finalize the authentication.
* - **27**, **28** and **29**
- The User is informed by the Wallet Instance that the Autentication succeded, then the protected resource is made available to the User.
Expand Down Expand Up @@ -106,7 +107,7 @@ A non-normative example of the HTTP request is represented below:
Content-Type: application/json

{
"authorization_endpoint": "https://wallet-solution.digital-strategy.europa.eu/authorization",
"authorization_endpoint": "openid4vp:",
peppelinux marked this conversation as resolved.
Show resolved Hide resolved
"response_types_supported": [
"vp_token"
],
Expand Down Expand Up @@ -160,7 +161,7 @@ Below a non-normative example of the response containing the required parameters

.. code-block:: javascript

https://wallet-solution.digital-strategy.europa.eu/authorization?client_id=...&request_uri=...&client_id_scheme=entity_id&request_uri_method=post
openid4vp://?client_id=...&request_uri=...&client_id_scheme=entity_id&request_uri_method=post

The value corresponding to the `request_uri` endpoint SHOULD be randomized, according to `RFC 9101, The OAuth 2.0 Authorization Framework: JWT-Secured Authorization Request (JAR) <https://www.rfc-editor.org/rfc/rfc9101.html#section-5.2.1>`_ Section 5.2.1.

Expand All @@ -170,7 +171,7 @@ In the **Same Device Flow** the Relying Party uses an HTTP response redirect (wi
.. code:: text

HTTP/1.1 /authorization Found
Location: https://wallet-solution.digital-strategy.europa.eu?
Location: openid4vp://?
client_id=https%3A%2F%2Frelying-party.example.org%2Fcb
&request_uri=https%3A%2F%2Frelying-party.example.org%2Frequest_uri
&client_id_scheme=entity_id
Expand All @@ -190,7 +191,7 @@ Below is represented a non-normative example of the QR Code raw payload:

.. code-block:: text

https://wallet-solution.digital-strategy.europa.eu/authorization?client_id=https%3A%2F%2Frelying-party.example.org&request_uri=https%3A%2F%2Frelying-party.example.org&client_id_scheme=entity_id&request_uri_method=post
openid4vp://?client_id=https%3A%2F%2Frelying-party.example.org&request_uri=https%3A%2F%2Frelying-party.example.org&client_id_scheme=entity_id&request_uri_method=post

.. note::
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.
Expand Down Expand Up @@ -233,7 +234,8 @@ Below a non-normative example of HTTP request made by the Wallet Instance to the
Request URI Response
--------------------

The Relying Party issues the signed Request Object, where a non-normative example in the form of decoded header and payload is shown below:
The Relying Party issues the signed Request Object using the content type set to ``application/oauth-authz-req+jwt``,
where a non-normative example in the form of decoded header and payload is shown below:

.. code-block:: text

Expand Down Expand Up @@ -327,8 +329,7 @@ The JWS payload parameters are described herein:

- ``presentation_definition``: JSON object according to `Presentation Exchange <https://identity.foundation/presentation-exchange/spec/v2.0.0/>`_. 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. The ``client_metadata`` parameter MUST NOT be present when ``client_id_scheme`` is ``entity_id``. Since the ``client_metadata`` is taken from ``trust_chain``, this parameter is intended to not be used.
- ``client_metadata_uri``: string containing an HTTPS URL pointing to a resource where a JSON object with the Relying Party metadata can be retrieved. The ``client_metadata_uri`` parameter MUST NOT be present when ``client_id_scheme`` is ``entity_id``. Since the ``client_metadata`` is taken from ``trust_chain``, this parameter is intended to not be used.
- ``client_metadata``: A JSON object containing the Relying Party metadata values. If the ``client_metadata`` parameter is present when ``client_id_scheme`` is ``entity_id``, the ``client_metadata`` MUST only contain the member ``jwks`` and containing ephemeral cryptographic public keys to be used only for the Wallet Instance with which the Relying Party is interacting with for this specific session.


Request URI Endpoint Errors
Expand Down Expand Up @@ -419,7 +420,7 @@ Below is a non-normative example of the decrypted payload of the JWT contained i
{
"id": "WalletAttestation",
"path": "$.vp_token[1]",
"format": "jwt"
"format": "wallet-attestation+jwt"
}
]
}
Expand All @@ -439,7 +440,7 @@ Where the following parameters are used:
- The requested Digital Credential (one or more, in format of SD-JWT VC or MDOC CBOR)
- The Wallet Attestation
* - **presentation_submission**
- JSON Object containing the mappings between the requested Verifiable Credentials and where to find them within the returned Verifiable Presentation Token, according to the `Presentation Exchange <https://identity.foundation/presentation-exchange/spec/v2.0.0/>`_.
- JSON Object containing the mappings between the requested Verifiable Credentials and where to find them within the returned Verifiable Presentation Token, according to the `Presentation Exchange <https://identity.foundation/presentation-exchange/spec/v2.0.0/>`_. This is expressed via elements in the ``descriptor_map`` array (Input Descriptor Mapping Objects) that contain a field called ``path``, which MUST have the value $ (top level root path) when only one Verifiable Presentation is contained in the VP Token, and MUST have the value $[n] (indexed path from root) when there are multiple Verifiable Presentations, where ``n`` is the index to select. The Relyingh PArty receiving the `presentation_submission` descriptor therefore is able to use the corred method to decode each credential data format provided withi nthe ``vp_token``.
peppelinux marked this conversation as resolved.
Show resolved Hide resolved
* - **state**
- Unique identifier provided by the Relying Party within the Authorization Request.

Expand Down
Loading
Loading