light-mode-image
Learn
Authorization Code flow

OID4VCI Authorization Code flow quickstart guide

This guide provides a quick overview of how to configure an OID4VCI Authorization 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 agrees to claim the offered credential.
  4. The user is redirected to complete authentication via Auth0.
  5. Upon successful authentication, the credential is issued to the wallet.

Prerequisites

Configure an Auth0 application

Create the application

  1. Log into Auth0.
  2. Select Create Application.
  3. Enter a name for your application.
  4. Select Regular Web Application.
  5. Select Create and then Skip Integration.

Configure application settings

  1. Record your application Domain, Client ID, and Client Secret.
  2. Scroll to Application URIs and add this URL to Allowed Callback URLs:
    https://{your_tenant_url}/core/v1/oauth/authentication/callback
    Replace {your_tenant_url} with your MATTR VII tenant URL.
  3. Select the Connections tab.
  4. Enable Username-Password-Authentication under Database.
  5. Disable all options under Social.

Create a test user

  1. Navigate to User Management > Users.
  2. Select Create User.
  3. Enter an Email (different from your Auth0 account email).
  4. Enter a Password.
  5. Select Username-Password-Authentication from the Connection dropdown.
  6. Select Create.
  7. Edit the user's Name to replace the default email value.

Configure MATTR VII

Configure Authentication provider

  1. In the MATTR Portal, expand Credential Issuance.
  2. Select Authentication provider.
  3. Enter your Auth0 Domain in the Base URL field (prefix with https://).
  4. Enter your Auth0 Client ID.
  5. Enter your Auth0 Client Secret.
  6. Select Create.

Create issuer certificate

  1. 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 Credential").

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

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

  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 Authorization 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. 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. Complete the authentication flow via Auth0.
  6. The credential will be issued to your wallet.

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

Next steps

How would you rate this page?