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

OID4VP profile for the W3C Digital Credentials API #155

Merged
merged 44 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
fb86e55
added sequence diagram for request uri flow
tlodderstedt Mar 29, 2024
e6c090a
first draft oid4vp profile for dc api
tlodderstedt Apr 14, 2024
4c11ded
fixed formatting
tlodderstedt Apr 14, 2024
95a4c0f
fixed typo
tlodderstedt Apr 15, 2024
f5ba49f
changed request to object
tlodderstedt Apr 17, 2024
278c475
updated PR based on IIW discussion on 04-18
tlodderstedt Apr 17, 2024
24b0573
modified JS code examples
tlodderstedt Apr 17, 2024
25702e0
Update openid-4-verifiable-presentations-1_0.md
tlodderstedt Apr 17, 2024
144f78b
reworked examples and added signed request sequence diagram
tlodderstedt Apr 17, 2024
0cfeb87
Merge branch 'browser_api' of https://github.com/openid/OpenID4VP int…
tlodderstedt Apr 17, 2024
baf35c9
Apply editorial suggestions from code review
Sakurann May 6, 2024
4a9f607
resolve merge conflict
May 28, 2024
96bf495
Apply text improvement suggestions from code review
Sakurann May 28, 2024
8d8d9dc
response is always json
Sakurann May 28, 2024
cb18fc2
how the wallet recieves origin info is out of scope of this profile
Sakurann May 28, 2024
ec2bb01
clarify there are two types of allowed request parameters
Sakurann May 28, 2024
40c9d11
merge remote
May 28, 2024
a264071
reference example file from the text
Jun 14, 2024
c85f012
remove a redundant example and extend one of the examples.
Jun 14, 2024
242fa62
move signed and unsigned request sections and clarify JARM and respon…
Jun 14, 2024
2907e60
Apply suggestions from Sam's code review
Sakurann Jun 19, 2024
f5f199c
merge main
Jun 20, 2024
4122a95
add a history entry
Jun 20, 2024
6d58f69
change to the request member of the API and use openid4vp instead of …
Jun 20, 2024
53fb19a
fix indentation
Jun 20, 2024
72f75c4
Apply suggestions from joseph's code review
Sakurann Jun 20, 2024
d89cd9c
fix request and response examples
Jun 20, 2024
9e583fd
move examples and clarify client_id is not allowed over the unsigned …
Jun 20, 2024
fbf9fe9
JSON -> JS object
Jun 20, 2024
ec75040
update examples
Jun 20, 2024
a15c41c
Apply suggestions from code review
Sakurann Jun 20, 2024
35af423
dropping client_id and client_id_scheme with signed requests
Sakurann Jun 20, 2024
81bfbb0
Apply suggestions from joseph's code review
Sakurann Jun 20, 2024
31ef192
Merge branch 'main' into browser_api
Sakurann Jun 24, 2024
af88822
Apply editorial suggestions from code review
Sakurann Jun 24, 2024
772f537
Apply editorial suggestions from code review
Sakurann Jul 2, 2024
792010e
more editorial. combining suggestions of multiple reviewers
Sakurann Jul 2, 2024
9a160de
remove a confusing expected_origins requirements
Sakurann Jul 2, 2024
084f112
Apply editorial suggestions from code review
Sakurann Jul 8, 2024
ffe96e5
Apply editorial suggestion from code review
Sakurann Jul 8, 2024
cf6aa75
change urn:openid.net:oid4vp to openid4vp
Sakurann Jul 8, 2024
13da249
removing "MUST contain a valid" openid4vp request
Sakurann Jul 8, 2024
4dd3893
changing the error handling
Sakurann Jul 8, 2024
e42c69b
in the examples change urn:openid.net:oid4vp to openid4vp and add res…
Sakurann Jul 8, 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
57 changes: 57 additions & 0 deletions diagrams/request_uri_mode_post_through_browser_api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
```plantuml
Copy link
Member

Choose a reason for hiding this comment

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

what happens to these files? asking for a friend

Copy link
Contributor

@marcoscaceres marcoscaceres Jul 1, 2024

Choose a reason for hiding this comment

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

same question (possibly same friend!) :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I checked this with Torsten - he would like these diagrams to be in the specification, but wasn't sure how to actually achieve that.

I've opened an issue - hopefully someone might be able to help us achieve that without any manual steps: #206

@startuml

autonumber

participant "User" as u

participant "Verifier Site" as r

participant "Web Platform" as wp

participant "App Platform" as ap

participant "Wallet" as w

u --> r : use
activate r

r -> wp: navigator.identity.get(\nprotocol="openid4vp",\nrequest="client_id,[client_id_scheme,] \nrequest_uri, request_uri_method=post, \npresentation_definition")

deactivate r
activate wp

wp -> ap: forward request (\norigin="example.verifier.com",\nprotocol="openid4vp",\nrequest="client_id,[client_id_scheme,] \nrequest_uri, request_uri_method=post,\n presentation_definition")
deactivate wp
activate ap

ap -> ap: match wallet
ap -> u: use this wallet?
u -> ap: confirmation

ap -> w: forward request (\norigin="example.verifier.com",\nprotocol="openid4vp",\nrequest="client_id,[client_id_scheme,] \nrequest_uri, request_uri_method=post,\n presentation_definition")
deactivate ap

activate w
w --> w: [optional. Check client_id with trust framework]
note over r,w
Note that the client_id is self asserted by the verifier.However as the request was dispatched through the browser API, the user consented to forward
the Verifier's request to the wallet. So even if the client_id is not trusted yet, the wallet might proceed and request the signed request object.
end note
w --> r: POST **request_uri** ([wallet_metadata][, wallet_nonce])
r -> r: create and sign (and optionally encrypt) request object
r --> w: **signed (optionally encrypted) request object** (client_id, client_id_scheme, wallet_nonce, nonce, \npresentation_definition, state)
w -> w: authenticate and\n authorize Verifier

note over u, w: User authentication and Credential selection/confirmation

w -> w: create credential presentation(s) \nassociated with nonce
w --> ap: send response \n(vp_token(credential presentation(s)),\n presentation_submission, state)
ap -> wp: send response \n(vp_token(credential presentation(s)),\n presentation_submission, state)
wp -> r: send response \n(vp_token(credential presentation(s)),\n presentation_submission, state)
r -> r: check state
activate r
r -> r: validate presentation \n(incl. nonce binding)
r -> r: use presented credential
@enduml
```
57 changes: 57 additions & 0 deletions diagrams/request_uri_mode_post_through_browser_api.plantuml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
```plantuml
@startuml

autonumber

participant "User" as u

participant "Verifier Site" as r

participant "Web Platform" as wp

participant "App Platform" as ap

participant "Wallet" as w

u --> r : use
activate r

r -> wp: navigator.identity.get(\nprotocol="openid4vp",\nrequest="client_id,[client_id_scheme,] \nrequest_uri, request_uri_method=post, \npresentation_definition")

deactivate r
activate wp

wp -> ap: forward request (\norigin="example.verifier.com",\nprotocol="openid4vp",\nrequest="client_id,[client_id_scheme,] \nrequest_uri, request_uri_method=post,\n presentation_definition")
deactivate wp
activate ap

ap -> ap: match wallet
ap -> u: use this wallet?
u -> ap: confirmation

ap -> w: forward request (\norigin="example.verifier.com",\nprotocol="openid4vp",\nrequest="client_id,[client_id_scheme,] \nrequest_uri, request_uri_method=post,\n presentation_definition")
deactivate ap

activate w
w --> w: [optional. Check client_id with trust framework]
note over r,w
Note that the client_id is self asserted by the verifier.However as the request was dispatched through the browser API, the user consented to forward
the Verifier's request to the wallet. So even if the client_id is not trusted yet, the wallet might proceed and request the signed request object.
end note
w --> r: POST **request_uri** ([wallet_metadata][, wallet_nonce])
r -> r: create and sign (and optionally encrypt) request object
r --> w: **signed (optionally encrypted) request object** (client_id, client_id_scheme, wallet_nonce, nonce, \npresentation_definition, state)
w -> w: authenticate and\n authorize Verifier

note over u, w: User authentication and Credential selection/confirmation

w -> w: create credential presentation(s) \nassociated with nonce
w --> ap: send response \n(vp_token(credential presentation(s)),\n presentation_submission, state)
ap -> wp: send response \n(vp_token(credential presentation(s)),\n presentation_submission, state)
wp -> r: send response \n(vp_token(credential presentation(s)),\n presentation_submission, state)
r -> r: check state
activate r
r -> r: validate presentation \n(incl. nonce binding)
r -> r: use presented credential
@enduml
```
54 changes: 54 additions & 0 deletions diagrams/signed_request_uri_through_browser_api.plantuml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
```plantuml
@startuml

autonumber

participant "User" as u

participant "Verifier Site" as r

participant "Web Platform" as wp

participant "App Platform" as ap

participant "Wallet" as w

u --> r : use
activate r

note over r,wp
Note that the signed request object contains the Verifier's origin.
end note
r -> wp: navigator.identity.get(\nprotocol="openid4vp",\nrequest="client_id,[client_id_scheme,] request")

deactivate r
activate wp

wp -> ap: forward request (\norigin="example.verifier.com",\nprotocol="openid4vp",\nrequest="client_id,[client_id_scheme,] request")
deactivate wp
activate ap

ap -> ap: match wallet
ap -> u: use this wallet?
u -> ap: confirmation

ap -> w: forward request (\norigin="example.verifier.com",\nprotocol="openid4vp",\nrequest="client_id,[client_id_scheme,] request")
deactivate ap

activate w
w -> w: authenticate Verifier by validating request signature (including trust chain)
w -> w: compare origin to origin in signed request

note over u, w: User authentication and Credential selection/confirmation

w -> w: create and encrypt credential presentation(s) \nassociated with nonce
w --> ap: send response \n(vp_token(credential presentation(s)),\n presentation_submission, state)
ap -> wp: send response \n(vp_token(credential presentation(s)),\n presentation_submission, state)
wp -> r: send response \n(vp_token(credential presentation(s)),\n presentation_submission, state)
r -> r: decrypt response
r -> r: check state
activate r
r -> r: validate presentation \n(incl. nonce binding)
r -> r: use presented credential
@enduml
```
6 changes: 6 additions & 0 deletions examples/digital_credentials_api/request_value.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"response_type": "vp_token",
"nonce": "n-0S6_WzA2Mj",
"client_metadata": {...},
"presentation_definition": {...}
}
4 changes: 4 additions & 0 deletions examples/digital_credentials_api/response_value.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presentation_submission": "...",
"vp_token": "..."
}
32 changes: 32 additions & 0 deletions examples/digital_credentials_api/signed_request_payload.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
Sakurann marked this conversation as resolved.
Show resolved Hide resolved
"client_id": "client.example.org",
Sakurann marked this conversation as resolved.
Show resolved Hide resolved
"client_id_scheme": "entity_id",
"expected_origins": [
"https://origin1.example.com",
"https://origin2.example.com"
],
"response_type": "vp_token",
Sakurann marked this conversation as resolved.
Show resolved Hide resolved
"response_mode": "w3c_dc_api.jwt",
"nonce": "n-0S6_WzA2Mj",
"client_metadata": {
"vp_formats": {
"vc+sd-jwt": {
"sd-jwt_alg_values": [ "PS256" ],
"kb-jwt_alg_values": [ "PS256" ]
}
},
"jwks": {
"keys": [
{
"kty": "EC",
"crv": "P-256",
"x": "MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4",
"y": "4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM",
"use": "enc",
"kid": "1"
}
]
}
},
"presentation_definition": {...}
}
Loading
Loading