Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

Issuing to a wallet (OpenID4VCI)

Riley has passed Cedar's data-handling course, and the training portal offers to add it to their wallet. This lesson follows that issuance with OpenID4VCI: who decides that Riley earned the credential, how an offer differs from the credential, how the wallet proves the key the credential will name, and why delivery is a lifecycle with pending and lost replies.

Authorization to receive a credential

On 2 October, Riley finished the last module of Cedar's data-handling course and passed the assessment. Cedar's training portal now shows a button: add this course to your wallet. Behind that button are two separate questions. Has Riley earned the credential? And how does the credential reach their wallet, and only their wallet?

Cedar answers the first question with its own records: the course, the assessment, and the account Riley signed in with. That is Cedar's business process, and no protocol makes the decision for it. A delivery protocol can only carry out a decision Cedar has already made.

OpenID for Verifiable Credential Issuance (OpenID4VCI) answers the second question, and it builds on OAuth. Cedar's credential issuer plays the part of a protected resource: its credential endpoint hands out credentials to anyone presenting a suitable access token. The wallet plays the client, and gets that access token from Cedar's authorization server through a grant, much as Exchanging a code for tokens described. The protected thing it receives is a credential instead of an API response.

A wallet that has never dealt with Cedar learns how to talk to it from the issuer's published metadata, at a well-known address under the issuer URL:

GET /.well-known/openid-credential-issuer HTTP/1.1
Host: credentials.cedar.example

{
  "credential_issuer": "https://credentials.cedar.example",
  "authorization_servers": ["https://login.cedar.example"],
  "credential_endpoint": "https://credentials.cedar.example/credential",
  "nonce_endpoint": "https://credentials.cedar.example/nonce",
  "deferred_credential_endpoint": "https://credentials.cedar.example/deferred",
  "notification_endpoint": "https://credentials.cedar.example/notification",
  "credential_configurations_supported": {
    "cedar-course": {
      "format": "dc+sd-jwt",
      "vct": "https://credentials.cedar.example/course-completion",
      "cryptographic_binding_methods_supported": ["jwk"],
      "credential_signing_alg_values_supported": ["ES256"],
      "proof_types_supported": {
        "jwt": { "proof_signing_alg_values_supported": ["ES256"] }
      }
    }
  }
}

Each entry under credential_configurations_supported is a credential configuration: one kind of credential Cedar issues, in one format, with the kind of key proof it expects. cedar-course is an SD-JWT course credential, the one Selective disclosure with SD-JWT took apart, bound to a key the wallet proves it holds.

How the wallet arrives at Cedar also matters. Riley starts from a QR code on the training portal they are signed in to. But a QR code is only an invitation, and anyone can print one that names credentials.cedar.example, or a look-alike address. The wallet should treat the invitation as untrusted input, show Riley which issuer it found from that issuer's metadata, and let the rest of the flow establish whether Cedar has anything for them.

The offer and the credential are different

The QR code carries a credential offer. Decoded, Riley's looks like this:

{
  "credential_issuer": "https://credentials.cedar.example",
  "credential_configuration_ids": ["cedar-course"],
  "grants": {
    "urn:ietf:params:oauth:grant-type:pre-authorized_code": {
      "pre-authorized_code": "rpKEjUObM8ThjXroWcy9ftUw0w5r0fyZ",
      "tx_code": {
        "input_mode": "numeric",
        "length": 6,
        "description": "Enter the code Cedar emailed to [email protected]"
      }
    }
  }
}

The offer names the issuer and the configuration on offer, and says how the wallet can obtain authorization. It is not the credential, and it does not prove anything to anyone. Cedar's issuance runs through five stages, and keeping them apart makes each failure easier to place:

  1. Course decision: Cedar decides what Riley has earned.
  2. Offer: names the issuer and the offered configuration.
  3. Authorization: gives the wallet authority to collect it, through a pre-authorized code or an authorization code.
  4. Credential request: the wallet asks for the credential, with the key proof the configuration requires.
  5. Credential response: the delivered result, which the wallet validates and stores.
Riley's issuance, from the course decision to the delivered credential. The offer is only an invitation: without the emailed transaction code, a copied offer gets no token.

Riley's offer uses the pre-authorized code grant. Cedar already knows who Riley is, because they are signed in to the training portal, so it mints a code tied to their course record and puts it in the offer. The wallet does not need to send them through a sign-in page again; it exchanges the code directly at Cedar's token endpoint.

That convenience has a cost. Whoever holds the offer holds the code. A colleague glancing at Riley's screen, or a forwarded screenshot, could scan the same QR code. The tx_code object is Cedar's protection against that: it tells the wallet that the token request also needs a six-digit transaction code, and Cedar sends that code to Riley's email rather than putting it in the QR code. The pre-authorized code alone is not enough. Cedar also accepts each code only once, and only for a short time.

POST /token HTTP/1.1
Host: login.cedar.example
Content-Type: application/x-www-form-urlencoded

grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Apre-authorized_code
&pre-authorized_code=rpKEjUObM8ThjXroWcy9ftUw0w5r0fyZ
&tx_code=493536

HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store

{
  "access_token": "JmUSA_GR5oRydzuynUykQ4bruIlD9PnZ",
  "token_type": "Bearer",
  "expires_in": 3600
}

The offer could instead have carried an authorization_code grant with an issuer_state value. The wallet would then send Riley through Cedar's ordinary sign-in, passing issuer_state back in the authorization request so Cedar can connect that sign-in to the offer it made. That suits a wallet that starts the flow on its own, or an issuer that wants to see the person sign in at the moment of issuance.

Bind the request to its purpose

The access token lets the wallet do one thing: collect the cedar-course credential from Cedar's credential endpoint. It is not a presentation Riley can show Northwind, and it is not a general Cedar token. If the wallet asked for a different configuration with it, Cedar should refuse.

The credential also needs a holder key, the cnf key Northwind will later check. The wallet generates a key pair and proves it holds the private half. First it asks Cedar's nonce endpoint for a fresh value, then it signs a key proof that includes it:

POST /nonce HTTP/1.1
Host: credentials.cedar.example

HTTP/1.1 200 OK
Cache-Control: no-store
{ "c_nonce": "S1yI08mmbB4xciZjy6x0zQ" }

Key proof header
{
  "typ": "openid4vci-proof+jwt",
  "alg": "ES256",
  "jwk": {
    "kty": "EC",
    "crv": "P-256",
    "x": "HUHZ44gDzvw4dKiztjfbdX4GkPgE6eKHu3r3f1wgfa4",
    "y": "aA19bcDxYdJl4ALGshINuCEjHSA-O_Z9UQOI6uhDhRU"
  }
}

Key proof payload
{
  "aud": "https://credentials.cedar.example",
  "iat": 1790949580,
  "nonce": "S1yI08mmbB4xciZjy6x0zQ"
}

POST /credential HTTP/1.1
Host: credentials.cedar.example
Authorization: Bearer JmUSA_GR5oRydzuynUykQ4bruIlD9PnZ
Content-Type: application/json

{
  "credential_configuration_id": "cedar-course",
  "proofs": {
    "jwt": ["eyJ0eXAiOiJvcGVuaWQ0dmNpLXByb29mK2p3dCIs..."]
  }
}

The proof's typ marks it as an OpenID4VCI key proof, so it cannot be mistaken for any other JWT signed with the same key. Its aud names Cedar's credential issuer and its nonce is the one Cedar just handed out, so a proof made for another issuer, or recorded from an earlier request, fails. The proof has no iss claim, because a wallet using a pre-authorized code without a client identifier leaves it out. Cedar verifies the signature with the key in the header, and if it issues the credential, that key becomes the cnf key inside it.

What the illustrative key proof does and does not establish
The proof establishesThe proof does not establish
The requester controls the private key matching the public key in the headerThat the requester is Riley
The proof was made for Cedar's credential issuerThat anyone has earned the cedar-course credential
The proof was made after Cedar issued this nonceHow well the phone protects the key, which needs separate evidence

The right-hand column is where wrong-person issuance hides. A wallet can prove it holds a key without proving that it belongs to Riley, rather than to someone who scanned their offer. Cedar therefore takes the credential's subject from the course record the pre-authorized code was minted for, never from anything the wallet sends, and issues it only if that record says the course was passed. The key proof answers which key the credential will name. Cedar's own records answer whether to issue it at all, and to whom.

Delivery is a lifecycle

Often the credential endpoint answers at once with HTTP 200 and the credential in a credentials array. Sometimes Cedar cannot produce it immediately, perhaps because its signing service queues requests at busy times. Then it answers with a deferred response:

HTTP/1.1 202 Accepted
Content-Type: application/json

{
  "transaction_id": "Z9scgMdj8ppe2b9c",
  "interval": 300
}

Five minutes later:

POST /deferred HTTP/1.1
Host: credentials.cedar.example
Authorization: Bearer JmUSA_GR5oRydzuynUykQ4bruIlD9PnZ
Content-Type: application/json

{ "transaction_id": "Z9scgMdj8ppe2b9c" }

HTTP/1.1 200 OK
Content-Type: application/json

{
  "credentials": [
    { "credential": "eyJhbGciOiJFUzI1NiIsInR5cCI6ImRjK3NkLWp3...~WyIyR0xD...~WyJpVkdq...~WyJGVDY1...~" }
  ],
  "notification_id": "rJK5SEdyt2ad"
}

The 202 is neither a failure nor a delivery. Cedar has accepted the request and owes the wallet a credential; the wallet waits at least interval seconds and asks again with the transaction_id. Reporting this moment as "issued" would be wrong, and so would reporting it as "failed" and inviting Riley to start over. The deferred request also carries the same access token, which is why Cedar issued that token for an hour rather than a few minutes. A token that expired while the credential was still pending would leave the wallet unable to collect it, so an issuer that defers sizes the token lifetime to cover the wait, or issues a refresh token alongside it.

Starting over is exactly what goes wrong when a connection drops. If Riley's phone loses signal after sending the credential request, the wallet cannot tell whether Cedar received it, and its retry should not leave Cedar signing two credentials for one course result. Cedar keeps one record per issuance and answers a repeat with the existing transaction rather than starting a new one. That record holds what is needed to reconcile: the course record, the configuration, the state of the transaction, and safe references. It does not hold the raw pre-authorized code, transaction code, access token or key proof, which could be replayed by anyone reading the logs.

Illustrative timeline of Riley's issuance on 2 October (UTC)
TimeEventWhat Cedar knows afterwards
13:58Offer shown; transaction code emailedAn invitation exists. Nothing is authorized or delivered
13:59Pre-authorized code redeemed with the transaction codeThe code is used up; a second redemption must fail
13:59Credential request with key proof; 202 returnedThe wallet controls the key; the credential is pending
14:05Deferred request returns the credentialThe credential was sent to the wallet
14:05Wallet reports credential_accepted to the notification endpointThe wallet says it validated and stored the credential

The wallet has its own checks before that last row. It verifies Cedar's signature with keys from Cedar's metadata, confirms the cnf key is the one it proved, and checks that the disclosures match the digests. Only then does it store the credential, under the same protection as its keys, and tell Cedar it was accepted. Had validation failed, it would report credential_failure instead.

Notice what the training portal knows throughout: that Riley signed in and clicked a button. A successful browser sign-in at 13:58 says nothing about whether a wallet holds the credential at 14:05. Only the issuance record, and the wallet's own report, can say that.

Check your understanding

Try these questions before moving on. If an answer isn't right, use the feedback and try again.

A wallet sends Cedar a valid key proof with Cedar's issuer as aud and a fresh nonce. What does that proof establish? 1 of 3

Choose one answer.

Cedar's credential endpoint answers a wallet's request with HTTP 202 and a transaction_id. How should this be reported? 2 of 3

Choose one answer.

A colleague photographs the QR code on Riley's screen, which holds Cedar's credential offer with a pre-authorized code. What stops the colleague's wallet collecting Riley's credential? 3 of 3

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity