Learn how to build an application that can present an mDoc remotely
Introduction
In this tutorial you will use the mDocs Holder SDKs to build an application that can present a claimed mDoc to a verifier remotely via a remote presentation workflow as per ISO/IEC 18013-7:2025 and OID4VP .
This app will support both same-device and cross-device workflows to accommodate flexible user journeys.
Same-device workflow
- The user interacts with a website on their mobile device browser.
- The user is asked to present information as part of the interaction.
- The user is redirected to the application you will build in this tutorial.
- The application authenticates the user.
- The user is informed of what information they are about to share and provide their consent.
- The user is redirected back to the browser where verification results are displayed, enabling them to continue with the interaction.
The result will look something like this:
Cross-device workflow
- The user interacts with a website on their desktop browser.
- The user is asked to present information as part of the interaction.
- The user scans a QR code using a mobile device where the tutorial application is installed.
- The tutorial application is launched on the mobile device.
- The tutorial application authenticates the user.
- The user is informed of what information they are about to share and provide their consent.
- Verification results are displayed in the user’s desktop browser, enabling them to continue with the interaction.
The result will look something like this:
Prerequisites
Before you get started, let’s make sure you have everything you need.
Prior knowledge
-
The verification workflow described in this tutorial is based on ISO/IEC 18013-7:2025 and OID4VP . If you are unfamiliar with these technical specifications, refer to our Docs section for more information:
- What are mDocs?
- What is credential verification?
- Breakdown of the remote presentation workflow.
-
We assume you have experience developing applications in the relevant programming languages and frameworks (Swift for iOS, Kotlin for Android and TypeScript for React Native).
If you need to get a holding solution up and running quickly with minimal development resources and in-house domain expertise, talk to us about our white-label MATTR GO Hold app which might be a good fit for you.
Assets
Development environment
Prerequisite tutorial
- You must complete the Claim a credential tutorial and claim the mDoc provided in the tutorial.
- This application is used as the base for the current tutorial.
Testing devices
Got everything? Let’s get going!
Tutorial steps
To enable a user to present a stored mDoc to a verifier via an online presentation workflow, you will build the following capabilities into your application:
- Register the verifier’s Authorization endpoint.
- Create an online presentation session.
- Handle a presentation request.
- Send a presentation response.
Step 1: Register the verifier’s Authorization endpoint
The Authorization endpoint is a URI associated with an application identifier in the MATTR VII tenant configuration. It is used to invoke an application that will handle the presentation request. The application then uses the URI to retrieve a request object, which details what information is required for verification.
Online verifiers are recommended to generate this URI as a Universal link for iOS and App Link for Android, as this enables them to explicitly define and validate applications that can respond to their verification requests.
However, for simplicity reasons in this tutorial our verifier is using a
custom URI scheme
for iOS and a deep link for Android,
both matching the default scheme defined by the OID4VP specification (mdoc-openid4vp
). This means
that you need to configure the application to be able to handle this custom URI scheme.
Step 2: Create an online presentation session
Now that the application can handle an OID4VP custom URI scheme, the next step is to build the capability to use the request URI to retrieve the request object. This object details:
- What credentials are required.
- What specific claims are required from these credentials.
- What MATTR VII tenant to interact with.
Step 3: Handle a presentation request
We will now build the capability to use information retrieved by the
createOnlinePresentationSession
function to handle the presentation request. This includes:
- Displaying what information is requested.
- Displaying what existing credentials match the requested information.
- Displaying what information from these existing claims will be shared with the verifier.
- Asking for the user’s consent to share requested information from matching credentials.
Step 4: Send response
After displaying matching credentials to the user and enabling them to select what credential to share, the last thing you need to do is build the capability to share the selected credential with the verifier.
Step 5: Test the application
Let’s test that the application is working as expected in both workflows.
Same-device workflow
- Run the app and then close it (this updates the app on your testing device).
- Use a browser on your testing mobile device to navigate to the MATTR Labs Maggie’s Groceries demo , where you must provide proof for purchasing an age restricted item.
- In the checkout area, use the dropdown list to select Generic Wallet.
- Select Share from wallet.
- Select Allow to open the tutorial application.
- The tutorial application should be launched on your testing mobile device.
- Select the credential you wish to send to the verifier from the list of matched credentials.
- Select Send Response.
- You should be redirected back to Maggie’s online store and see a Over 18 years old verified indication.
- You can now proceed with the interaction (don’t expect any items to be shipped to you by Maggie’s though).
The result will look something like this:
Cross-device workflow
- Run the app and then close it (this updates the app on your testing device).
- Use a desktop browser to navigate to the MATTR Labs Maggie’s Groceries demo , where you must provide proof for purchasing an age restricted item.
- In the checkout area, use the dropdown list to select Generic Wallet.
- Select Share from wallet.
- Open the camera on your testing mobile device and scan the QR code.
- Confirm opening the QR code with your tutorial application.
- The tutorial application should be launched on your testing mobile device.
- Select the credential you wish to send to the verifier from the list of matched credentials.
- Select Send Response.
- Back on your desktop browser, you should see a Over 18 years old verified indication.
- You can proceed with the interaction (don’t expect any items to be shipped to you by Maggie’s though).
The result will look something like this:
Summary
You have just used the mDocs Holder SDKs to build an application that can present a claimed mDoc to a verifier remotely via an online presentation workflow as per ISO/IEC 18013-7:2025 and OID4VP .
This was achieved by building the following capabilities into the application:
- Handle an OID4VP request URI.
- Create an online presentation session.
- Handle a presentation request.
- Send a presentation response.
What’s next?
- You can build additional capabilities into your new application:
- Present a claimed mDoc for verification via a proximity presentation workflow.
- You can build a web application that will interact with your wallet application via an online verification workflow.
- You can check out the SDKs reference documentation for more details on the available functions and classes: