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

Advanced flow #52

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
55d221f
added sequence diagram
tlodderstedt Sep 27, 2023
b3dbced
first draft of the advanced flow
tlodderstedt Sep 27, 2023
f261533
discovery example
tlodderstedt Sep 27, 2023
2758f55
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 4, 2023
f64854e
changed into to overall description
tlodderstedt Oct 4, 2023
41e0018
Merge branch 'advanced_flow' of https://github.com/openid/OpenID4VP i…
tlodderstedt Oct 4, 2023
c3cbb89
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 4, 2023
92579f6
added text re issuer URL
tlodderstedt Oct 4, 2023
77c2af2
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 4, 2023
2763e59
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 4, 2023
e0a72b1
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 4, 2023
ef1773c
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 4, 2023
dd4831f
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 4, 2023
540e6c8
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 4, 2023
b73cd10
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 4, 2023
47e91d3
changed section title and first sentence
tlodderstedt Oct 4, 2023
3ca1dc0
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 4, 2023
47752aa
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 4, 2023
9ae3e30
detailed step 2
tlodderstedt Oct 4, 2023
03d291f
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 4, 2023
ed38346
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 4, 2023
95fcfb9
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 5, 2023
78345d4
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 5, 2023
72c2967
text on well-known location
tlodderstedt Oct 5, 2023
0873d4a
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 5, 2023
874f13c
nits
tlodderstedt Oct 5, 2023
01339f9
changed label of overview section
tlodderstedt Oct 5, 2023
ba781a1
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 16, 2023
03649aa
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 16, 2023
67420e6
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 16, 2023
cafba20
modified presentation request response to provide request object in r…
tlodderstedt Oct 16, 2023
fff23fc
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 16, 2023
08d02a0
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 16, 2023
ad91012
rewrote Discovery Endpoint section to not require a HTTPS endpoint
tlodderstedt Oct 16, 2023
ca8a978
Merge branch 'advanced_flow' of https://github.com/openid/OpenID4VP i…
tlodderstedt Oct 16, 2023
b469b1f
modified w_nonce definition to incorporate Giuseppe's comment
tlodderstedt Oct 16, 2023
a25840a
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 16, 2023
0a85508
changed context to interaction
tlodderstedt Oct 16, 2023
32259a1
Merge branch 'advanced_flow' of https://github.com/openid/OpenID4VP i…
tlodderstedt Oct 16, 2023
e8f97ac
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Oct 25, 2023
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
48 changes: 48 additions & 0 deletions diagrams/advanced_flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
```plantuml
@startuml

autonumber

participant "User Agent" as u

box "Verifier"
participant "Frontend" as r
participant "Presentation Endpoint" as rp
participant "Response Endpoint" as rb
end box

box "Wallet"
participant "Discovery Endpoint" as w
participant "Metadata" as wm
end box

u --> r : use
activate r

r --> u: **discover request**\n(presentation_uri, context)
deactivate r
u --> w: **discover request**\n(presentation_uri, context)
Comment on lines +22 to +24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
r --> u: **discover request**\n(presentation_uri, context)
deactivate r
u --> w: **discover request**\n(presentation_uri, context)
r --> u: **discovery request**\n(presentation_uri, context)
deactivate r
u --> w: **discovery request**\n(presentation_uri, context)

activate w
w --> rp: **create presentation request** (context, iss, w_nonce, \nwallet attestation, **wallet attestation pop(v_nonce)**)
note over u, w: HTTP status code 401 signals need to authenticate
rp --> wm: get wallet metadata
wm --> rp: wallet metadata
rp -> rp: create and sign presentation request object (client_id, w_nonce, nonce, response_uri, \npresentation_definition, state)
rp --> w: **signed request object** (client_id, w_nonce, nonce, response_uri, \npresentation_definition, state)
note over u, w: do we want to allow unsigned presentation request objects, too?
w -> w: authenticate and\n authorize Verifier

note over u, w: user authentication and credential selection/confirmation

w -> w: create verifiable\npresentation (credential)
w --> rb: post response \n(vp_token, presentation_submission, state)
rb --> w: redirect_url
w --> u: response (response_code)
u --> r: response (response_code)
activate r
r --> rb: get presentation response\n (transaction_id, response_code)
rb --> r: presentation response
r -> r: validate presentation \n(incl. nonce binding)
r -> r: use presented credential
@enduml
```
4 changes: 4 additions & 0 deletions examples/discovery/discover.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presentation_request_uri": "verifier.example.com/presentation_request",
"context": "register_kyc"
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could these kind of small examples be in the text and not as a separate file..?

Copy link
Member

@bc-pi bc-pi Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is inline, I just used to file to format the example - can remove it once we merge

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

131 changes: 130 additions & 1 deletion openid-4-verifiable-presentations-1_0.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ This specification supports any Credential format used in the Issuer-Holder-Veri

Implementations can use any pre-existing OAuth 2.0 Grant Type and Response Type in conjunction with this specification to support different deployment architectures.

OpenID for Verifiable Presentations supports scenarios where the Authorization Request is sent both when the Verifier is interacting with the End-User using the device that is the same or different from the device on which requested Credential(s) are stored.
OpenID for Verifiable Presentations supports scenarios where the Authorization Request is sent both when the Verifier is interacting with the End-User using the device that is the same or different from the device on which requested Credential(s) are stored.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this sentence was there previously, but I have a hard time parsing it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, let's try to make it simpler.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestions welcome

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
OpenID for Verifiable Presentations supports scenarios where the Authorization Request is sent both when the Verifier is interacting with the End-User using the device that is the same or different from the device on which requested Credential(s) are stored.
OpenID for Verifiable Presentations supports scenarios where the Authorization Request is handled by user-agent within the same device where the requested Credential(s) are stored, and scenarios where the Authorization Request is handled by user-agent on a different device from the one where the requested Credential(s) are stored. In the latter case, an example is the End-User getting authenticated to a Verifier using both the user-agent on a workstation and a personal mobile device.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably it is worst than before ... let's see if something might be useful.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
OpenID for Verifiable Presentations supports scenarios where the Authorization Request is sent both when the Verifier is interacting with the End-User using the device that is the same or different from the device on which requested Credential(s) are stored.
OpenID for Verifiable Presentations supports the scenario in which the Verifier sends an Authorization Request to an End-User using either the same or different device from which the requested Credential(s) are stored.

how's this?


This specification also provides the Verifier an option to first discover the Wallet's capabilities before the actual presentation request is created and passed to the Wallet.

This specification supports the response being sent using a redirect but also using an HTTPS POST request. This enables the response to be sent across devices, or when the response size exceeds the redirect URL character size limitation.

Expand Down Expand Up @@ -215,6 +217,55 @@ Figure: Cross Device Flow

(3) The Wallet prepares the Verifiable Presentation(s) of the Verifiable Credential(s) that the End-User has consented to. It then sends to the Verifier an Authorization Response where the Verifiable Presentation(s) are contained in the `vp_token` parameter.

## Same Device Flow with Wallet Capabilities Discovery {#same_device_with_discovery}
tlodderstedt marked this conversation as resolved.
Show resolved Hide resolved

Below is a diagram that shows the flow as described in (#same_device), but with an additional pre-step used that allows the Verifier to discover the Wallet's capabilities and tailor the actual request.
tlodderstedt marked this conversation as resolved.
Show resolved Hide resolved

In this case, the Verifier starts the flow by discovering the Wallet's capabilities through an additional message exchange. This is especially useful, if the Verifier starts the process using a URL serving as alias for a group of wallets (e.g. a custom scheme) but would like to tailor the presentation request to the particular wallet.
tlodderstedt marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In this case, the Verifier starts the flow by discovering the Wallet's capabilities through an additional message exchange. This is especially useful, if the Verifier starts the process using a URL serving as alias for a group of wallets (e.g. a custom scheme) but would like to tailor the presentation request to the particular wallet.
In this case, the Verifier starts the flow by discovering the Wallet's capabilities through a specialized message exchange. This is useful when the Verifier starts the process using a URL serving as alias for a group of Wallets (e.g. a custom scheme) with the requirement to tailor the presentation request to each particular Wallet.


In this flow, the Verifier first prepares a discovery request to be provided to the Wallet. The Wallet answers this request by sending an HTTP POST request to the Verifier, providing the Verifier with its Issuer URL (identifying the wallet provider and used to fetch wallet metadata) and further parameters. The Verifier then creates a presentation request tailored to the capabilities and trust domain of the particular Wallet and passes the request object in the HTTP POST response. The rest of the flow works like described in (#same_device). The discovery request can also be used in cross device scenarios where the Verifier would render the discovery message in a QR code.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In this flow, the Verifier first prepares a discovery request to be provided to the Wallet. The Wallet answers this request by sending an HTTP POST request to the Verifier, providing the Verifier with its Issuer URL (identifying the wallet provider and used to fetch wallet metadata) and further parameters. The Verifier then creates a presentation request tailored to the capabilities and trust domain of the particular Wallet and passes the request object in the HTTP POST response. The rest of the flow works like described in (#same_device). The discovery request can also be used in cross device scenarios where the Verifier would render the discovery message in a QR code.
In this flow, the Verifier first prepares a discovery request to be provided to the Wallet. The Wallet reacts to this request by sending an HTTP POST request to the Verifier, providing the Verifier with its Issuer URL (identifying the wallet provider and used to fetch wallet metadata) and further parameters. The Verifier then creates a presentation request tailored to the capabilities and trust domain of the particular Wallet and passes the request object in the HTTP POST response. The rest of the flow works like described in (#same_device). The discovery request can also be used in cross device scenarios where the Verifier would render the discovery message in a QR code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In this flow, the Verifier first prepares a discovery request to be provided to the Wallet. The Wallet answers this request by sending an HTTP POST request to the Verifier, providing the Verifier with its Issuer URL (identifying the wallet provider and used to fetch wallet metadata) and further parameters. The Verifier then creates a presentation request tailored to the capabilities and trust domain of the particular Wallet and passes the request object in the HTTP POST response. The rest of the flow works like described in (#same_device). The discovery request can also be used in cross device scenarios where the Verifier would render the discovery message in a QR code.
In this flow, the Verifier first prepares a discovery request to be provided to the Wallet. The Wallet answers this request by sending an HTTP POST request to the Verifier, providing the Wallet metadata and any other further parameters. The Verifier then creates a presentation request tailored to the capabilities and security requirements of the particular Wallet and passes the request object in the HTTP POST response. The rest of the flow continues as described in (#same_device). The discovery request can also be used in Cross-Device scenarios where the Verifier would render the discovery message in a QR code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

identifying the wallet provider and used to fetch wallet metadata at a first glance seems a weak assumption since it is not mandate that the wallet metadata should be obtained from an online endpoint. Such as some the wallet provider endpoint. I always keep in mind the offline flows.

Other cases where the trust model requires that the metadata would be provided from trusted lists or other kind of signed artifacts that would be given directly within the http post parameters

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the verifier receives a request via HTTPS, I don't see how this works for offline scenarios


Note: The diagram does not illustrate all the optional features of this specification.

Note: The usage of the Request URI as defined in [@!RFC9101] does not depend on any other choices made in the protocol extensibility points, i.e., it can be used in the Same Device Flow, too.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Note: The usage of the Request URI as defined in [@!RFC9101] does not depend on any other choices made in the protocol extensibility points, i.e., it can be used in the Same Device Flow, too.
Note: The usage of the Request URI as defined in [@!RFC9101] does not depend on any other choices made in the protocol extensibility points, i.e., it can be used in the Same-Device Flow, too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I have enough context for understanding the relevance of this sentence here; the section did not talk about request URI so far. Should this be moved somewhere else?

tlodderstedt marked this conversation as resolved.
Show resolved Hide resolved

!---
~~~ ascii-art
~~~ ascii-art
+--------------+ +--------------+ +--------------+
| User | | Verifier | | Wallet |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| User | | Verifier | | Wallet |
| End-User | | Verifier | | Wallet |

+--------------+ +--------------+ +--------------+
| | |
| Interacts | |
|---------------->| |
| | (1) Discovery Request |
| | (Presentation Request URI) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, it's a Presentation Request Request URI. That sounds stupid, so we might call it Fetch Presentation Request URI or something similar.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interaction between the End-User and the Verifier is misleading, we assume that the End-User is able to interact with a Verifier only though an user-agent or a wallet instance

Copy link
Member

@peppelinux peppelinux Oct 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fetch Presentation Request URI doesn't sound familiar to me. I would keep a small set of terms ... something that I can quickly refer to the scope/feature of this flow/endpoint

I'd propose Wallet Discovery Response URI, that's the endpoint that receives the wallet answer to the discovery call :-)

| |-------------------------------------------------->|
| | |
| | (2) Request the Request Object |
Copy link
Collaborator

@Sakurann Sakurann Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think (2) is mainly a "Discovery Response", that also happens to trigger request object from the verifier.

Copy link
Collaborator

@Sakurann Sakurann Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| | (2) Request the Request Object |
| | (2) Discovery Response |
| |(Wallet's endpoint, capabilities, Attestation, etc)|

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is discovery, but the result is a request object

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this reminds me the italian flow where we have mixed the provisioning of the wia with DPoP to the request_uri endpoint.

We are looking for a better specialization of the endpoints, then the proposed, alternative, flow was provided in this comment: #52 (comment)

| |<--------------------------------------------------|
| | |
| | (2.5) Respond with the Request Object |
| | (Presentation Definition) |
| |-------------------------------------------------->|
| | |
| User Authentication / Consent |
| | |
| | (3) Authorization Response |
| | (VP Token with Verifiable Presentation(s)) |
| |<--------------------------------------------------|
~~~
!---
Figure: Cross Device Flow
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Figure: Cross Device Flow
Figure: Wallet Discovery Flow

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to "Same Device Flow with Wallet Capabilities Discovery"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to cover both cross device and same device within this PR

an alternative flow was provided aiming to satisfy this: #52 (comment)


(1) The Verifier sends to the Wallet a Discovery Request that contains a Presentation URI to where Wallet can send information about itself and obtain the Request Object containing the actual Authorization Request.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since custom scheme is mentioned above, the path of this request through the user agent should be shown in the ascii art above, like in the plantuml.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This level of detail is used in same device section, too. I suggest to file an issue to change both.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(1) The Verifier sends to the Wallet a Discovery Request that contains a Presentation URI to where Wallet can send information about itself and obtain the Request Object containing the actual Authorization Request.
(1) The Verifier sends to the Wallet a Discovery Request that contains a Presentation Request URI to where Wallet can send information about itself and obtain the Request Object containing the actual Authorization Request.

Copy link
Member

@peppelinux peppelinux Oct 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(1) The Verifier sends to the Wallet a Discovery Request that contains a Presentation URI to where Wallet can send information about itself and obtain the Request Object containing the actual Authorization Request.
(1) The Verifier sends to the Wallet a Discovery Request that contains a Presentation URI to where Wallet MAY send information about itself and obtain the Request Object containing the actual Authorization Request.

we assume that a wallet instance may not support this feature, in this cases we should give some guidance to the implementers. I assume that the Verifier would go ahead with predefined parameters

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


(2) The Wallet sends an HTTPS POST request to the Presentation URI. The request contains information about the context as defined by the Verifier, the wallet's Issuer URL and may contain further parameters (including a wallet attestation).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(2) The Wallet sends an HTTPS POST request to the Presentation URI. The request contains information about the context as defined by the Verifier, the wallet's Issuer URL and may contain further parameters (including a wallet attestation).
(2) The Wallet sends an HTTPS POST request to the Presentation Request URI. The request contains information about the context as defined by the Verifier, the wallet's Issuer URL and may contain further parameters (including a wallet attestation).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(2) The Wallet sends an HTTPS POST request to the Presentation URI. The request contains information about the context as defined by the Verifier, the wallet's Issuer URL and may contain further parameters (including a wallet attestation).
(2) The Wallet sends an HTTPS POST request to the Presentation URI. The request contains information about the context as defined by the Verifier, the Wallet's metadata and any further parameters, such as for example the Wallet attestation.


(2.5) The HTTPS POST response returns the Request Object containing Authorization Request parameters based on the information specific to the Wallet that it received in step (2). It especially contains a Presentation Definition as defined in [@!DIF.PresentationExchange] that describes the requirements of the Credential(s) that the Verifier is requesting to be presented. Such requirements could include what type of Credential(s), in what format(s), which individual Claims within those Credential(s) (Selective Disclosure), etc. The Wallet processes the Request Object and determines what Credentials are available matching the Verifier's request. The Wallet also authenticates the End-User and gathers her consent to present the requested Credentials.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not remark this since there may be cases where the OAuth 2.0 scopes are used and PE might not be used


(3) The Wallet prepares the Verifiable Presentation(s) of the Verifiable Credential(s) that the End-User has consented to. It then sends to the Verifier an Authorization Response where the Verifiable Presentation(s) are contained in the `vp_token` parameter.

# Scope

OpenID for Verifiable Presentations extends existing OAuth 2.0 mechanisms as following:
Expand All @@ -228,6 +279,84 @@ OpenID for Verifiable Presentations extends existing OAuth 2.0 mechanisms as fol

Presentation of Verifiable Credentials using OpenID for Verifiable Presentations can be combined with the user authentication using [@SIOPv2], and the issuance of OAuth 2.0 Access Tokens.

# Discovery Request

The Discovery Request allows Verifers to discover the Wallet's capabilities before they create the actual presentation request. It also allows the Wallet to authenticate towards the Verifier and to provide the Verifier with additional data used in the creation of the request signature and to encrypt the request at the application layer (if needed).
Copy link
Collaborator

@Sakurann Sakurann Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The Discovery Request allows Verifers to discover the Wallet's capabilities before they create the actual presentation request. It also allows the Wallet to authenticate towards the Verifier and to provide the Verifier with additional data used in the creation of the request signature and to encrypt the request at the application layer (if needed).
The Discovery Request allows Verifeirs to discover the information about the Wallet before creating the actual presentation request. It allows the Wallet to optionally authenticate towards the Verifier and to provide with additional data such as its endpoint and capabilities. This enables the Verifier to sign the request using the algorithm that the Wallet is guaranteed to support and if needed encrypt the request at the application layer.

in my mind, wallet's endpoint, wallet's capabilities, and wallet attestation are three different things, and I am not sure "wallet capabilities" can be used to express them all

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that the wallet instance attestation contains the wallet's capabilities, materially defined with:

  • cnf.jwk (any other cnf.*)
  • NiST's AAL (the equivalence of the italian attested_security_contexts)
  • Authorization Server metadata
  • other wallet instance metadata, as client_metadata when a wallet instance acts like a Verifier.

Copy link
Collaborator Author

@tlodderstedt tlodderstedt Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sakurann those three things are differentiated in the current text. wallet capabilities is in the first sentence, authentication in the second sentence

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peppelinux I assume the capabilities are conveyed using wallet metadata. I agree, there can be other ways. Let's discuss how we can support them.


This specification defines the following new parameters for the Discovery Request message:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This specification defines the following new parameters for the Discovery Request message:
This specification defines the following parameters for the Discovery Request message:


`presentation_request_uri`:
: A string containing an HTTPS URL pointing to a resource under the control of the Verifier where the Wallet is supposed to obtain the presentation request object.
Comment on lines +288 to +289
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think presentation_request_uri parameter name could be more explicit and differentiate it more clearly from request_uri in rfc9101..? something like discovery_and_request_uri (yes, I know i am not brilliant at names)?

I would also borrow some language from https://www.rfc-editor.org/rfc/rfc9101#section-5-2.4 like

Suggested change
`presentation_request_uri`:
: A string containing an HTTPS URL pointing to a resource under the control of the Verifier where the Wallet is supposed to obtain the presentation request object.
`presentation_request_uri`:
: The absolute URI, as defined by [RFC 3986](https://www.rfc-editor.org/rfc/rfc9101#RFC3986) [[RFC3986](https://www.rfc-editor.org/rfc/rfc9101#RFC3986)], that receives data from the Wallet such as endpoint, capabilities and attestation and returns the [Request Object](https://www.rfc-editor.org/rfc/rfc9101#name-request-object) containing the authorization request parameters defined in [Section 5](https://openid.bitbucket.io/connect/openid-4-verifiable-presentations-1_0.html#section-5).

not sure we need If this parameter is present in the authorization request, request MUST NOT be present.

Copy link
Member

@peppelinux peppelinux Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not in favor of discovery AND request, since I assume that there might be cases where a wallet solution doesn't support the discovery feature then the request_uri endpoint should be untouched

I assume, according to my implementations, that the RP that can't assert the wallet capabilities should attests to the wallet instance the lowest level of security, if supported for the requirements of the LoA, and using a standard/defined/wellknown and common capabilities for the wallet ecosystems

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea in the PR is to have a new endpoint (the presentation endpoint) that bundles discovery and request creation. We could also split this into discovery and request_uri. However I would like to understand the consequences. What directly comes to mind is that the state must be kept at the verifier between the two requests whereas the current design allows the verifier to create the request and directly release it to the wallet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sakurann I suggest to call it fetch_presentation_request_uri (see my comment further up) as the current name is not correct.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm for discovery_response_uri where the HTTP response could be 302 Found with the discovery_state that binds the discovery to the request issuance

then we have divided the endpoints by using the request_uri endpoint with the sole addition of the discovery_state that allows the RP to do its lookups. This value could be also encrypted (depending by what would cost more in an infrastructure: CPU or Storage!)


`context`:
: A string identifying the context of the discovery request from the perspective of the Verifier. The value is opqaue to the Wallet, it MUST pass this value to the Presentation Endpoint Request (see below).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is best to avoid using a term context in anything issuer-holder-verifier model related... (because it has a very specific meaning in w3c vcdm)

Suggested change
`context`:
: A string identifying the context of the discovery request from the perspective of the Verifier. The value is opqaue to the Wallet, it MUST pass this value to the Presentation Endpoint Request (see below).
`verifier_state`:
: A value opaque to the Wallet used by the Verifier to maintain state between discovery request and response. When received, the Wallet MUST pass this value to the Presentation Endpoint.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intentionally did not designate it as state as it is intended to be used to label the context ("entrance to east wing") and not carry a certain state of a certain transaction. This allows to use the same discovery request for multiple transactions (print it out and put it onto the wall).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is good to use something distinct from state (and I agree with Torsten's arguments). context feels ok to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fully agree with Kristina, context is something too much related to other specs and schemas.
I propose discovery_state with the will to keep the words always on the same direction, the good semantic help us to reduce the brain stress

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: A string identifying the context of the discovery request from the perspective of the Verifier. The value is opqaue to the Wallet, it MUST pass this value to the Presentation Endpoint Request (see below).
: A string identifying the context of the discovery request from the perspective of the Verifier. The value is opaque to the Wallet, it MUST pass this value to the Presentation Endpoint Request (see below).


The Discovery Request MUST be represented as a JSON object with all parameters as top-level JSON claims.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is surprising. Why would this be JSON? The two parameters should be simple URL parameters.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The Discovery Request MUST be represented as a JSON object with all parameters as top-level JSON claims.
The Discovery Request MUST be a JSON object with all members in the top-level.


The following is an example request:

```JSON
{
"presentation_request_uri": "verifier.example.com/presentation_request",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"presentation_request_uri": "verifier.example.com/presentation_request",
"presentation_request_uri": "https://verifier.example.com/presentation_request",

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

according to my rpevious comments, it would be

"discovery_response_uri": "https://verifier.example.com/discovery-response"

"context": "register_kyc"
tlodderstedt marked this conversation as resolved.
Show resolved Hide resolved
}
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to note that parameter names might change based on the comments above.


The Discovery Request is either sent to the Discovery Endpoint of the Wallet or is rendered as a QR Code.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The Discovery Request is either sent to the Discovery Endpoint of the Wallet or is rendered as a QR Code.
The Verifier can navigate the user agent to the Discovery Endpoint URL or render the URL as a QR Code for cross-device scenarios.


Note: the Discovery Request intentionally does not use OAuth parameters, such as a `client_id`. The idea is to allow the Verifier to select the Client Identifier it wants to use for interacting with the Wallet after it has determined the trust mechanisms and domains the Wallet supports.

## Discovery Endpoint
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this section needs to be in the Verifier Metadata section https://openid.bitbucket.io/connect/openid-4-verifiable-presentations-1_0.html#name-wallet-metadata-authorizati and not here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This endpoint is not the typical static "get some metadata" endpoint. It is part of the application logic of the wallet. I therefore added it here. I think this is the best solution for readability and understandability.


This is an HTTPS endpoint offered by the Wallet. The Discovery Request MUST be sent as an HTTPS GET request or an HTTP redirect to the Discovery Endpoint URL defined in (#wallet-metadata).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is an HTTPS endpoint offered by the Wallet. The Discovery Request MUST be sent as an HTTPS GET request or an HTTP redirect to the Discovery Endpoint URL defined in (#wallet-metadata).
This is an HTTPS endpoint offered by the Wallet. The Discovery Request MUST be sent as an HTTPS GET request to the Discovery Endpoint URL defined in (#wallet-metadata).

The redirection is still a GET request.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an HTTPS endpoint offered by the Wallet.

please don't, we should assume that the wallet should not require any online HTTPs endpoint

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are absolutely right, I rewrote the section. please have a look


The HTTPS URL MUST contain a single URI query parameter `discovery` where the value is the JSON object as defined above.

## Presentation Endpoint

The Presentation Endpoint is an HTTPS endpoint exposed by the Verifier.
Comment on lines +315 to +317
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Presentation Endpoint
The Presentation Endpoint is an HTTPS endpoint exposed by the Verifier.
## Presentation Request Endpoint
The Presentation Request Endpoint is an HTTPS endpoint exposed by the Verifier.

... or Fetch Presentation Request Endpoint if renaming is agreed upon.


### Presentation Request
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not comfortable calling this presentation request. requests in OID4VP are from the verifier. it is confusing to introduce a request coming from the wallet. why can't this be a discovery response to discovey request from the verifier? or wallet capability offer to learn from VCI


Presentation Requests MUST be HTTPS POST requests with the "application/json" media type.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Presentation Requests MUST be HTTPS POST requests with the "application/json" media type.
Presentation Requests MUST be HTTPS POST requests with the content type "application/json" containing a JSON-encoded object with the parameters described in the following.


The follwowing parameters are defined:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The follwowing parameters are defined:
This specification defines the following new parameters:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please indicate which parameters is REQUIRED vs OPTIONAL - hard to review without that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The follwowing parameters are defined:
The following parameters are defined:


`context`:
: A JSON String containing the value of the corresponding Discovery Request's `context` parameter.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`context`:
: A JSON String containing the value of the corresponding Discovery Request's `context` parameter.
`verifier_state`:
: A JSON String containing the value of the corresponding Discovery Request's `verifier_state` parameter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: A JSON String containing the value of the corresponding Discovery Request's `context` parameter.
: A string containing the value of the corresponding Discovery Request's `context` parameter.

There is no need to repeat "JSON" in the parameter definition of an object that itself is JSON encoded (and it may lead to misinterpretation).


`issuer`:
: A JSON containing an HTTPS URL designating the Issuer URL of the Wallet. The Verifier can obtain the Wallet's metadata by adding the well-know location `oauth-authorization-server` as specifid in [@!RFC8414].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: A JSON containing an HTTPS URL designating the Issuer URL of the Wallet. The Verifier can obtain the Wallet's metadata by adding the well-know location `oauth-authorization-server` as specifid in [@!RFC8414].
: An HTTPS URL designating the Issuer URL of the Wallet. The Verifier can obtain the Wallet's metadata by accessing the well-known location `oauth-authorization-server` as specified in [@!RFC8414].

Copy link
Member

@peppelinux peppelinux Oct 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this term Issuer URL of the Wallet or Issuer URL is misleading, would it mean Wallet Provider?

I'm strongly not in favour of requiring the entities to be online and that the wallet might exposes its metadata thought the wallet providers endpoints

the wallet instance attestation would be the best place, attestable and non-repudiable, where the wallet metadata can be provided.


`w_nonce`:
: A JSON String containg a cryptographic nonce the Verifier MUST use when creating the signed presentation request object.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: A JSON String containg a cryptographic nonce the Verifier MUST use when creating the signed presentation request object.
: A string containing a cryptographic nonce the Verifier MUST use when creating the signed presentation request object.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use where?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where the reader is able to distinguish between nonce and cryptographic nonce?
I would suggest a ref where the definition of cryptographic nonce is provided and the way to issue it


`client_assertion`
: A JSON String containing a Wallet attestation along with a proof of possession of the configuration key as defined in [@!I-D.ietf-oauth-attestation-based-client-auth]. This assertion is used to authenticate the Wallet towards the Verifier.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: A JSON String containing a Wallet attestation along with a proof of possession of the configuration key as defined in [@!I-D.ietf-oauth-attestation-based-client-auth]. This assertion is used to authenticate the Wallet towards the Verifier.
: A string containing a Wallet attestation along with a proof of possession of the configuration key as defined in [@!I-D.ietf-oauth-attestation-based-client-auth]. This assertion is used to authenticate the Wallet towards the Verifier.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why isn't it a JSON string in this case?

tlodderstedt marked this conversation as resolved.
Show resolved Hide resolved

### Presentation Response
tlodderstedt marked this conversation as resolved.
Show resolved Hide resolved

Presentation Response MUST be HTTPS POST response with the "application/json" media type.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modify as for the request above


The follwowing parameters are defined:

`request`:
: A JSON String containing the signed request object as defined in [@RFC9101]. It MUST fulfill the requirements as defined in (#vp_token_request).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is confusing. why is there suddenly a need to define a top level claim? usually the entire object in the response is a request object without any top level claims. the parameter name also conflicts with the request parameter defined in rfc 9101 to pass the request by value

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, I would just put the whole thing into the response body.



### Presentation Error Response
tlodderstedt marked this conversation as resolved.
Show resolved Hide resolved

The error code `401` signals to the Wallet that it needs to authenticate to the Verifier. In this case, the error response SHOULD contain a `WWW-Authenticate` header for every attestation method the Verifier supports.

Below a non-normative example for the Wallet attestation method as specified above. The `WWW-Authenticate` contains the nonce value the Wallet MUST use in the calculation of the proof of possession of the wallet attestation.

```
HTTP/1.1 401 Unauthorized
WWW-Authenticate: wallet-attestation error="use_nonce", \
error_description="Verifier requires wallet attestation"
Nonce: eyJ7S_zG.eyJH0-Z.HX4w-7v
```

# Authorization Request {#vp_token_request}

The Authorization Request follows the definition given in [@!RFC6749] taking into account the recommendations given in [@!I-D.ietf-oauth-security-topics].
Expand Down
Loading