light-mode-image
Learn
Pre-authorized Code flow

OID4VCI Pre-authorized Code flow quickstart guide

This guide provides a quick overview of how to configure an OID4VCI Pre-authorized Code flow using the MATTR Portal to issue an mDoc to a digital wallet.

Use this guide as a quick reference to get started. For detailed information and API examples, explore the tutorial and reference documentation.

User experience

OID4VCI Tutorial Workflow

This is the user experience you will build:

  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.

Prerequisites

Configure MATTR VII

Create issuer certificate

  1. In the MATTR Portal, expand Platform Management.
  2. Select Certificates.
  3. Select Create new.
  4. Select IACA - Issuing Authority Certificate Authority as the type.
  5. Select MATTR managed as the management method.
  6. Select Create.
  7. Set Status to Active.
  8. Select Update to activate the certificate.

Create mDoc credential configuration

  1. Expand Credential Issuance.

  2. Select Mobile credential.

  3. Select Create new.

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

  5. Enter a Description (e.g., "For High Assurance Interactions").

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

  7. Paste the following JSON into Claim mappings:

    Claim mappings object
    {
      "com.example.personaldetails.1": {
        "name": {
          "mapFrom": "claims.name",
          "type": "string"
        },
        "email": {
          "mapFrom": "claims.email",
          "type": "string"
        }
      }
    }
  8. Enter "1" in the Months field under Validity for.

  9. Select Create.

Generate Credential offer

  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 displayed on screen.
  9. Download and save the QR code.

Claim the credential

  1. Open the GO Hold example app.
  2. Select Scan.
  3. Scan the QR code you generated.
  4. Review the credential offer and select Accept.
  5. Enter the Transaction code when prompted.
  6. The credential will be issued to your wallet.

Congratulations! You've successfully configured an OID4VCI Pre-authorized Code flow and issued an mDoc to a digital wallet.

Next steps

How would you rate this page?