Auth0’s Mobile Driver’s License Verification Service is in Early Access. To enable this feature, review and complete the Terms and Conditions form, and our team will be in contact with you. To learn more about Auth0’s release stages, read Product Release Stages.
Verification Presentation Request
To create a Verification Presentation Request, your application calls the mDL Verification API to initiate a verification flow. The Verification Presentation Request returns a URI with the presentation request information for the user’s digital wallet to consume. Your application presents the URI to the user in the form of a link and prompts them to share their credential with your application. The Verification Presentation Request also returns averificationId
. Your application uses the verificationId
to poll the status of the request.
Update .env file
The instructions follow along with the hands-on lab using a Next.js application. You can access our GitHub repository.
.env
file. The API calls to create and poll the verification request require repeated access to Auth0 variables. We recommend you set these variables as environment variables in your application.
For a Next.js application, edit the .env.local file and set the corresponding values:
AUTH0_DOMAIN
: The Domain specified under the application’s BasicInformation in . Defines the Application performing the Verification Request.PROTOCOL
: The protocol determines the method used for interacting with the wallet.TEMPLATE_ID
: The Template ID from the template you created.VERIFICATION_BEARER_TOKEN
: The Verification Bearer Token that is generated based on your , , , and Grant Type that allows your application to call the Verification Service.
Verification Template
The Verification Template defines the fields you want to request from a user’s digital wallet, including mDL claims. The Verification Template is part of the first call to the mDL Verification API. You can create the Verification Template using the Auth0 Dashboard or . Currently, Auth0 only supports the mDoc credential type. An mDoc is a binary data object for representing a driver’s license as defined in Annex A of the ISO/IEC TS 18013-7:2024 standard.You should only request verification data that is essential for your business purposes.
mDL claims
Claims, which are different from claims, are specific to the mDL Verifiable Credential. The claims are attributes associated with the user that could be sensitive, personally identifiable information (PII). You can request the following claims:family_name
given_name
birth_date
issue_date
expiry_date
issuing_country
issuing_authority
portrait
driving_privileges
resident_address
portrait_capture_date
age_in_years
age_birth_year
age_over_NN
issuing_jurisdiction
nationality
resident_city
resident_state
resident_postal_code
resident_country
family_name_national_character
given_name_national_character
Create a Verification Template
- Navigate to Auth0 Dashboard > Credentials > Verification.
- Select + Add Verification Template.
- Name the template.
- Choose the claims you want to request from the user’s mDL.
- Select Create Verification Template.
Create a Verification Presentation Request
A Verification Presentation Request keeps track of a verification request in Auth0. To initiate a Verification Presentation Request within your application:- Create a new folder named api in the same folder where the index.js file is located.
- Create a new folder named verify in the api folder you created.
- Create a new file named start.js in the api/verify folder.
-
Add the following code snippet to the start.js file:
The snippet imports the node-fetch module, which you use to make
HTTP
calls to the Mobile Driver’s License Verification API. -
Map the environment variables from the .env.local file. If you are using Next.js, it will parse this file by default and map the variables to the
process.env
object: -
Add the code snippets to the start.js file.
-
The
handler()
function handlesHTTP
requests in an API route. -
The
run()
function makes aPOST
request to the Mobile Driver’s License Verification API to start a verification request. The returned object has two variables:-
engagement
: The URIwith the verification request information for the end user’s wallet to consume. -
verificationId
: Auth0’s unique identifier of the verification request.
-
-
The
Prompt the user to present a credential
To prompt the user to present a credential, you must provide the returned engagement URI. The first API request to initiate the verification request returns an engagement URI and Verification ID for the user. We recommend you display the engagement link in the form of a QR code or link. If the user is on a device that their wallet is not, such as a tablet or computer, a QR code is helpful. To learn more, review the Node.js example. If the user is on their mobile device, the link prompts the end user to open their wallet and based on the requested type of credentials, the wallet may auto-select an appropriate credential. The user is usually prompted for consent.Check the Verification Presentation Request’s status
Once you create a verification request, the application needs to know if the user consented to submit a credential to Auth0. To do that, we need to poll the status of the Verification Presentation Request. To do so:- Create a new file named check.js in the /api/verify folder you already created.
-
Import the
node-fetch
library and load the required environment variables. -
The
HTTP
handler is similar to the previous one, but the Verification ID must be extracted from the VerificationPOST
request body so your application can exchange the requested claims with Auth0: -
Implement the
run()
function. This function uses the Verification ID to exchange the requested claims with Auth0 and returns the result.
Verification Request data storage
The claims requested will be available in the result and can be used based on your business needs. If additional storage is required, read Understand How Metadata Works in User Profiles.Auth0 metadata is not a secure data store and should not be used to store sensitive information. This includes secrets and high-risk PII like social security numbers or credit card numbers, etc. Auth0 customers are strongly encouraged to evaluate the data stored in metadata and only store that which is necessary for identity and access management purposes. To learn more, read Auth0 General Data Protection Regulation Compliance.