RepoMicrosoftMicrosoftpublished Nov 17, 2022seen 1w

microsoft/entra-verifiedid-wallet-library-android

Kotlin

Open original ↗

Captured source

source ↗

microsoft/entra-verifiedid-wallet-library-android

Description: A library to manage your Decentralized Identities and Verified IDs on Android.

Language: Kotlin

License: MIT

Stars: 26

Forks: 14

Open issues: 9

Created: 2022-11-17T18:59:22Z

Pushed: 2026-06-19T05:46:17Z

Default branch: dev

Fork: no

Archived: no

README:

Microsoft Entra Wallet Library

![badge-privatepreview] ![badge-packagemanagers-supported] ![badge-package-version] ![badge-languages] ![badge-platforms] ![badge-license] ![badge-azure-pipline]

Introduction

The Microsoft Entra Wallet Library for Android gives your app the ability to begin using the Microsoft Entra Verified Id platform by supporting the issuance and presentation of Verified Ids in accordance with OpenID Connect, Presentation Exchange, Verifiable Credentials, and more up and coming industry standards.

---

Requirements

The library runs on a minimum sdk version 26. The app consuming the library should have minsdk version set to at least 26.

Installation

Releases are not maintained for this repository. To use this library, add this project as a submodule to your repository.

> You may wish to fork this repo to adjust gradle files as appropriate.

git submodule add https://github.com/microsoft/entra-verifiedid-wallet-library-android.git

Then either use the Android Studio "New Module" and "Import..." option with the /walletlibrary folder, or manually add the module by modifying

settings.gradle

include ':walletlibrary'
project(':walletlibrary').projectDir = new File(rootDir, 'entra-verifiedid-wallet-library-android/walletlibrary/')

Copy the expected variables from gradle.properties into the root project's gradle.properties.

Add to your app's build.gradle to add Wallet Library as a dependency:

dependencies {
implementation project(':walletlibrary')
}

Add to repositories section of your app's settings.gradle.

maven { url "https://jitpack.io" }

Quick Start

Here is a simple example of how to use the library. For more in-depth examples, check out the sample app.

// Create a verifiedIdClient
val verifiedIdClient = VerifiedIdClientBuilder(context).build()

// Create a VerifiedIdRequestInput using a OpenId Request Uri.
val verifiedIdRequestUrl = VerifiedIdRequestURL(Uri.parse("openid-vc://..."))
val verifiedIdRequestResult: Result> = verifiedIdClient.createRequest(verifiedIdRequestUrl)

// Every external method's return value is wrapped in a Result object to ensure proper error handling.
if (verifiedIdRequestResult.isSuccess) {
val verifiedIdRequest = verifiedIdRequestResult.getOrNull()
val presentationRequest = verifiedIdRequest?.let {
verifiedIdRequest as VerifiedIdPresentationRequest
}
} else {
// If an exception occurs, its value can be accessed here.
val exception = verifiedIdRequestResult.exceptionOrNull()
}

At the time of publish, we support the following requirements on a request: | Requirement | Description | Supported on Request | |------------------------------ |------------- |------------------------------ | | GroupRequirement | A verifier/issuer could request multiple requirements. If more than one requirement is requested, a GroupRequirement contains a list of the requirements. | Issuance/Presentation | | VerifiedIdRequirement | A verifier/issuer can request a VerifiedId. See below for helper methods to fulfill the requirement. | Presentation (Issuance coming end of June) | | SelfAttestedClaimRequirement | An issuer might require a self-attested claim that is simply a string value. | Issuance | | PinRequirement | An issuer might require a pin from user. | Issuance | | AccessTokenRequirement | An issuer might request an Access Token. An Access Token must be retrieved using an external library. | Issuance | | IdTokenRequirement | An issuer might request an Id Token. If the Id Token is not already injected into the request, an Id Token must be retrieved using an external library. | Issuance |

To fulfill a requirement, cast it to the correct Requirement type and use the fulfill method.

val verifiedIdRequirement = presentationRequest.requirement as VerifiedIdRequirement
verifiedIdRequirement.fulfill(verifiedId)

VerifiedIdRequirement contains a helper function getMatches that will filter all of the VerifiedId that satisfies the constraints on the VerifiedIdRequirement from a list of VerifiedIds.

val matchingVerifiedIds = verifiedIdRequirement.getMatches(verifiedIds: List)

You can also validate a requirement to ensure the requirement has been fulfilled.

val validationResult = verifiedIdRequirement.validate()

Once all of the requirements are fulfilled, you can double check that the request has been satisfied by calling the isSatisfied method on the request object.

val isSatisfied = presentationRequest.isSatisfied()

Then, complete the request using the complete method.

  • The complete method on a VerifiedIdIssuanceRequest returns a successful result that contains the issued VerifiedId, or if an error occurs, returns a failure result with the error.
  • The complete method on a VerifiedIdPresentationRequest returns an empty successful result or if an error occurs, returns a failure result with the error.
val result = presentationRequest.complete()

---

VerifiedId

A Verified Id is a verifiable piece of information that contains claims about an entity.

Style

Issuers have the ability to customize the style of a Verified Id. We support BasicVerifiedIdStyle which contains basic traits like name, issuer, background color, text color, and logo that can be used to represent the look and feel of a Verified Id.

Storing VerifiedIds

It is the responsibility of the app developer to store the VerifiedIds. We have included helper functions to encode/decode VerifiedIds to easily store the VerifiedIds in a database as a primitive type.

// Encode a VerifiedId into String.
val encodedVerifiedIdString = verifiedIdClient.encode(verifiedId)
// Decode a VerifiedId from String.
val verifiedId = verifiedIdClient.decodeVerifiedId(encodedVerifiedIdString)

Sample App

1. Clone this repository. 2. Open the WalletLibrary workspace in Android Studio. 3. Run the following command from the location where repository was cloned. It initializes the git submodules.

git submodule update --init --recursive

4. Create a test device. 5. Run the walletlibarydemo app....

Excerpt shown — open the source for the full document.

Notability

notability 3.0/10

Routine library release, low stars.