light-mode-image
Learn
Pre-authorized Code flow

OID4VCI Pre-authorized Code flow quickstart guide

This quickstart is for evaluating MATTR’s OID4VCI Pre-authorized Code flow issuance capabilities. In about 10-15 minutes you will configure an OID4VCI Pre-authorized Code flow in the MATTR Portal, generate a credential offer, and claim an mDoc into the GO Hold example app.

Estimated time: 10-15 minutes.

Use this guide as a fast evaluation path to see the flow working end-to-end. For detailed information and API examples, explore the tutorial and reference documentation.

User experience

In this quickstart you will perform this exact flow yourself using the MATTR Portal and the GO Hold example app:

OID4VCI Tutorial Workflow

  1. User scans a QR code from an issuer.
  2. The wallet displays what credential is being offered.
  3. The user accepts the offer and provides a transaction code.
  4. The credential is immediately issued to the wallet.

In this flow there is no user authentication step, making it a great option for low-risk credentials or use cases where the user has already authenticated through another channel (e.g., a mobile app).

Prerequisites

Steps

Create issuer certificate (2 minutes)

This allows your tenant to act as an issuing authority for mDocs in this demo. This step is only required if you haven't already set up an issuer certificate for your tenant. If you already have an active IACA, skip to the next step.

  1. Log into the MATTR Portal.
  2. Switch to your tenant if you have access to multiple tenants, or create a new tenant if needed.
  3. Expand Platform Management.
  4. Select Certificates.
  5. Select Create new.
  6. Select IACA - Issuing Authority Certificate Authority as the type.
  7. Select MATTR managed as the management method.
  8. Select Create.
  9. Set Status to Active.
  10. Select Update to activate the certificate.

Create mDoc credential configuration (3 minutes)

In this quickstart you’ll use a simple credential configuration so you can issue a credential without integrating any external data sources:

  1. Expand Credential Issuance.

  2. Select mDocs.

  3. Select Create new.

  4. Enter a Name (e.g., "My First Credential").

  5. Enter a Description (e.g., "Claimed via Pre-authorized Code flow").

  6. Enter a Credential type (e.g., com.example.preauthcredential).

  7. Paste the following JSON into Claim mappings:

    Claim mappings object
    {
      "com.example.personaldetails.1": {
        "name": {
          "defaultValue": "Emma Tasma",
          "type": "string"
        },
        "email": {
          "defaultValue": "emma.tasma@example.com",
          "type": "string"
        }
      }
    }
  8. Enter "1" in the Months field under Validity for.

  9. Select Create.

Generate a credential offer (2 minutes)

This creates the OID4VCI offer that wallets can use to start the Pre-authorized Code flow.

  1. Expand Credential Issuance.
  2. Select Credential offer.
  3. Select Pre-authorized code flow as the workflow.
  4. Select the Select button.
  5. Check the checkbox next to your credential configuration.
  6. Select Apply.
  7. Select Generate.
  8. Copy the Transaction code that is displayed on the screen.
    In production deployments you will need to provide it to the user through a different channel (e.g., email, SMS).
  9. Download the displayed QR code (or just leave it on the screen for scanning in the next step).

Claim the credential (2 minutes)

Now use the GO Hold example wallet to experience the end-to-end flow from QR scan to credential in the wallet:

  1. Open the GO Hold example app.
  2. Select Share on the home screen.
  3. Select Respond or Collect (You may need to allow the app to access your camera).
  4. Scan the QR code you generated in the previous step.
  5. Review the credential offer and select Proceed.
  6. Enter the Transaction code you copied earlier.
  7. The new credential should now be visible in the GO Hold example app.

Behind the scenes, MATTR handled the OID4VCI Pre-authorized Code flow, including validating the Transaction code and credential offer details and issuing the mDoc to your GO Hold example app.

Congratulations! You've successfully configured an OID4VCI Pre-authorized Code flow and issued an mDoc to a digital wallet using only MATTR Portal configuration and the GO Hold example app.

Next steps

  • For your evaluation:
    • Note how long this quickstart took and any friction you encountered.
    • Review the credential configuration and consider how it would map to your real data.
  • Explore the OID4VCI Pre-authorized Code flow tutorial for detailed instructions and explanations.
  • Try the OID4VCI Authorization Code flow for a different issuance workflow with user authentication.

How would you rate this page?

Last updated on

On this page