Presenting from a wallet (OpenID4VP)
Northwind's project workspace asks Riley to prove the course with their walletAn application that holds a person's verifiable credentials and the keys that go with them, receives credentials from issuers, and presents them to verifiers when the person agrees.. This lesson follows that exchange with OpenID4VP: how the verifier asks for exactly the evidence it needs, how the response is bound to this one request, what the evidence does and does not establish, and how each kind of refusal should be handled.
A request for evidence in this transaction
On 16 October, Riley opens Northwind's project workspace on their laptop for the first time. Instead of a sign-up form, the page shows a QR code and a line of text: Northwind needs to confirm you have completed the data-handling course. Riley scans the code with their phone, and their wallet takes over.
What happens next follows OpenID for Verifiable Presentations (OpenID4VP). It borrows the shape of an OAuthA framework that lets a person give an application limited access to their resources at another service, using tokens instead of sharing their password. OAuth is about access; OpenID Connect adds sign-in. authorizationDeciding whether a requested action is permitted, such as whether a signed-in account may delete a particular photo. Authentication says which account is asking; authorization decides what it can do. request, with Northwind's verifier in the role of the client and Riley's wallet in the role that would normally be played by an authorization serverIn OAuth, the service that handles a person's sign-in and approval and decides which tokens to issue to a client. It may belong to the same company as the API, but its job is separate.. The verifier says what it wants, and the wallet answers with a presentation instead of a code or tokenA piece of data issued by a trusted service that a client presents as a credential, for example to call an API or to report a sign-in. Some tokens carry readable claims; others are random strings that only the issuer can interpret.. OpenID4VP carries the request and the response; the credential format, here the SD-JWTA signed JWT whose claims are replaced by digests, with each claim's value kept in a separate disclosure. The holder sends only the disclosures it chooses, so a verifier sees just the claims it needs. from Selective disclosure with SD-JWT, still defines how the evidence inside is protected and checked.
The QR code holds very little: Northwind's client identifier and a request_uri from which the wallet fetches the full request. That request comes back as a signed JWTA JSON Web Token: a compact token made of Base64url-encoded parts that carries claims and is usually signed. Anyone holding it can decode and read the claims, so the signature shows who issued it but hides nothing.. Northwind's client identifier, x509_san_dns:verifier.northwind.example, tells the wallet how to authenticate it: the request must be signed with a certificateA signed statement that a public key belongs to a name, such as a website's hostname, for stated purposes and a limited period. A certificate authority signs it, so software that trusts the authority can connect the key to the name. issued for the DNSThe Domain Name System, the internet's lookup service that turns a domain such as photos.example into the address of the computer serving it. Whoever controls a name's DNS records controls where that name points. name verifier.northwind.example, from a certificate authorityAn organization that checks who controls a name and then signs certificates for it. Browsers and other software trust a chosen set of authorities, and through them the certificates those authorities issue. the wallet trusts. The wallet checks that signatureA value made with a private key that lets anyone holding the matching public key check that a message came from the key's holder and has not been changed. It proves origin and integrity; it does not hide the message., and checks that the address the response will go to sits on the same name. Only then does it show Riley who is asking.
{
"client_id": "x509_san_dns:verifier.northwind.example",
"response_type": "vp_token",
"response_mode": "direct_post",
"response_uri": "https://verifier.northwind.example/response",
"nonce": "Zf_4b7lKBqU3rsSa",
"state": "TVYlKPxixFdM7ud8SnRcyw",
"dcql_query": {
"credentials": [
{
"id": "course_credential",
"format": "dc+sd-jwt",
"meta": {
"vct_values": ["https://credentials.cedar.example/course-completion"]
},
"claims": [
{ "path": ["course"] },
{ "path": ["result"] }
]
}
]
}
}response_type=vp_token asks for a presentation. response_mode=direct_post tells the wallet to send its answer straight to response_uri with an HTTPThe Hypertext Transfer Protocol, the rules browsers, apps, and servers use to send requests and responses on the web. POST, rather than back through the laptop's browser, which suits a request that started on another device. The nonce is a fresh random value for this request alone, and state lets Northwind find this request again when the answer arrives.
The dcql_query is the request's shopping list, written in the Digital Credentials Query Language (DCQL). It asks for one credential, an SD-JWT of Cedar's course-completion type, and within it only the course and result claims. Riley's wallet finds their credential, and shows them that Northwind's verifier is asking for those two claims. Their email stays behind, because nobody asked for it.
Notice what the wallet relied on to name the requester: a signature it could check against a certificate it trusts. A familiar logo on the laptop screen, or a QR code that arrived in an unexpected email, establishes nothing on its own.
Bind the response to the request
Riley approves, and the wallet builds a presentation: the issuer-signed JWT, the course and result disclosures, and a Key Binding JWT whose aud is Northwind's client identifier and whose nonce is the one from this request. It posts the result to the response URI.
POST /response HTTP/1.1
Host: verifier.northwind.example
Content-Type: application/x-www-form-urlencoded
vp_token=...&state=TVYlKPxixFdM7ud8SnRcyw
vp_token, decoded:
{
"course_credential": [
"eyJhbGciOiJFUzI1NiIsInR5cCI6ImRjK3NkLWp3...~WyIyR0xD...~WyJpVkdq...~eyJhbGciOiJFUzI1NiIsInR5cCI6ImtiK2p3dCJ9..."
]
}The vp_token is keyed by the id from the query, so Northwind knows which requested credential each presentation answers. Northwind uses state to look up the transaction it started, and from that transaction it knows the nonce it sent. Then it compares.
A week earlier, a copy of a presentation Riley made for a previous Northwind pilot ended up in a debugging log. Suppose that copy is sent to the response URI now, along with one Riley made for an unrelated verifier. All three presentations carry a valid Cedar credential and correct disclosures. Only the Key Binding JWT tells them apart:
| Presentation | aud | nonce | Outcome |
|---|---|---|---|
| Made for this request, 16 October | x509_san_dns:verifier.northwind.example | Zf_4b7lKBqU3rsSa | Accepted, if the remaining checks pass |
| Copied from the 9 October pilot | x509_san_dns:verifier.northwind.example | pwgguAFYfNEy26AW | Refused: the nonce belongs to an earlier request |
| Made for another verifier | x509_san_dns:verify.other.example | That verifier's nonce | Refused: the audience is another verifier |
The old presentation is the instructive one. Its credential is genuine, its disclosures match, its holder signature verifies, and it was even made for Northwind. It still does not answer today's request, because it was made for a different one. A verifier that checks everything except the nonce will accept anything that ever passed through its logs.
The answer is also not an ID token, even though the request looked like OAuth. An ID token says that an identity provider authenticated someone for a client. A vp_token carries credentials issued by someone else, presented by a holder, and Northwind validates it under the rules of its credential format. Three different keys are involved, and each has its own source. Cedar's signing key comes from Cedar's metadata, Riley's holder key from the cnf claim Cedar signed, and Northwind's own key from its certificate. A key that arrives in the response cannot become a trusted issuer key because the presenter supplied it.
Decide what the evidence establishes
With the Key Binding JWT confirmed, Northwind makes the checks from Issuers, holders, and verifiers. Cedar's signature verifies with a key from Cedar's metadata, and Cedar is an accepted issuer for this credential type. The credential is within its validity period, and its entry on Cedar's status list is not revoked. The disclosures match their digests, and the holder signature comes from the cnf key. Both required claims are present: course is cedar-basic and result is passed.
Only now does Northwind ask its own question, whether this meets the project prerequisite, and the answer is yes. If a required claim had been missing, the answer would have been an explicit no, or an offer of another way to show the course, never a permission inferred from the fact that a response arrived.
The answer covers the prerequisite and nothing else. Riley can now be added to the project, but whether they can open the workspace, edit its documents, or administer it is Northwind's ordinary authorization decision, based on the role it gives them. Riley meets the course requirement and has no administrator role, so an administrator action is still refused.
Northwind records the outcome: prerequisite met for Riley, by a Cedar course credential, in transaction TVYlKPxixFdM7ud8SnRcyw on 16 October. It does not keep the presentation itself. The pilot's copy in a debugging log shows what a kept presentation becomes.
A useful refusal explains the boundary
Not every exchange ends with a presentation, and the ways it can fail need different responses from Northwind.
| What happened | What Northwind sees | A sensible next step |
|---|---|---|
| Riley declined to share | An error response, access_denied | Respect it, and mention any other way to meet the prerequisite |
| The wallet had no suitable credential | Usually the same access_denied | Offer another way to meet the prerequisite |
| The exchange broke down | No response before the request expired | Start a fresh request with a new nonce |
| A response failed a check | A presentation that did not validate | Refuse, and say which check failed in terms Riley can act on |
The first two rows look the same on purpose. A wallet need not tell a verifier whether the person refused or simply had nothing to show, because that difference is itself information about the person. Northwind's page should therefore work for both: no pressure to try again and share after all, and a clear route for someone who has not taken the course. A transport failure is different, since nothing was decided, and a new request is the honest fix.
The cross-device design that made Riley's experience easy also changes the risks. The QR code connects their wallet to whatever session displayed it, and their phone cannot see the laptop. An attacker running a convincing copy of Northwind's workspace could show Northwind's genuine QR code on their own page. Riley's wallet would correctly name Northwind as the verifier, and their presentation would complete a session that belongs to the attacker. Wallets reduce this by making the requester and purpose prominent, and people reduce it by sharing only from flows they started themselves.
When the wallet and the browser are on the same phone, Northwind can close the gap. After receiving the direct post, its response endpoint returns a redirect_uri carrying a one-time response_code. The wallet opens it in the browser, and Northwind accepts the result only if that code arrives in the same browser session that started the request. Which mechanisms a given wallet and verifier support depends on the profile they have agreed on, so Northwind tests the combinations it accepts rather than assuming every wallet behaves alike.
Browsers now offer a cleaner same-device path that removes the QR code altogether: the Digital Credentials API. Instead of displaying a code, Northwind's page calls the browser, which asks the operating system which wallets can answer and returns the chosen wallet's response. Because the request now comes from a web page, the wallet names the requester by its web origin rather than by a scanned code, and the response is bound to that origin. That closes the copied-QR-code gap for the same-device case, since an attacker's page cannot make the wallet bind a presentation to Northwind's origin. The cross-device QR flow remains for the case where the wallet is on a different device, and OpenID4VP carries the presentation over either path.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Verify an OpenID4VP response against its DCQL requestMatch a wallet's vp_token to Northwind's DCQL query, verify the SD-JWT VC and its KB-JWT for this verifier and nonce, then see a missing claim, an old pilot copy and a relayed presentation refused.