Testing Credential Issuance
What We Are Doing:
Running the server.
Using the reference Empe DID Wallet to claim the issued credential.
Confirming the credential was claimed by inspecting the issuance session.
Why: To make sure the end-to-end issuance flow works before we add the Verifier. A successful test proves that our backend can authenticate to the Issuer API, create a credential offer, and that a wallet can claim the offered credential.
Before you start: Two things must be true for the offer to reach the wallet:
The server must be authenticated to the Issuer API. Every call our backend makes to the Issuer carries an OIDC access token as
Authorization: Bearer <token>(theISSUER_ACCESS_TOKENfrom your.env). If the token is missing or invalid, the offer call fails and no QR code is produced. (Running locally withAUTH_DISABLED=true? Then no token is needed — see Authenticating to the API.)The offer must be reachable from the phone. The credential offer is an
openid-credential-offer://URI that points the wallet back at the Issuer'sISSUER_BASE_URL. Your phone resolves that URL directly, so it cannot belocalhost— use a host the device can reach (a LAN IP or a public HTTPS URL). In production, OpenID4VCI requires HTTPS.
Steps:
Run the application:
node src/index.jsOpen
http://localhost:4000/in your browser.Fill out the form (age, firstName, lastName) and submit. Your backend calls the Issuer to create a credential offer and returns a QR code rendering that offer.
A QR code appears. Open the Empe DID Wallet on your phone and scan it. The wallet resolves the offer, contacts the Issuer, and stores the issued credential.
Confirming the credential was claimed
When you created the offer, the Issuer returned an issuanceSessionId. You can use it to check the session state and confirm the wallet completed the claim:
Endpoint: GET /issuance-sessions/:sessionId
Response Body:
The session starts at OfferCreated. Once the wallet claims the credential, state becomes Completed and issuedCredentials lists the issued credential IDs. If something goes wrong, state is Error and errorMessage explains why.
If the QR scan succeeded and the session reports Completed, you have successfully issued a credential. Next, we will deploy and integrate the Verifier to check this credential.
Last updated