Skip to main content

Mobile WebWallet SDK - Android

Docs for the iOS WebWallet SDK are here.

This is a lightweight, fully native SDK that allows a host app to perform web wallet authentication functionality in a chrome browser. It works with both Kotlin and Java native apps.

note

An example project using this SDK can be found here. This serves as a useful technical reference.

Overview

Minimum Requirements

  • Android 6.0 (Marshmallow) and above

Installation

In the app level build.gradle add the following maven repository:


android {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/UnumID/UnumIDWebWallet-android")
}
}

......

In the app level build.gradle add the reference to the SDK

implementation "id.unum:webwallet-android:(insert latest version)"

For the most current version, visit here

Performing User DID Association

More details on the

A DID (or decentralized identifier) identifies a participant in the Unum ID ecosystem. A participant is an issuer, subject, or verifier.
Example: ACME Bank is identified by two DIDs, one for acting as an issuer and another for acting as a verifier. Richard, an ACME subject (user), is identified by one DID. Hooli FinTech, which acts as a verifier, is identified by one DID.
Components: The Server SDK returns DIDs for issuers and verifiers, and the Mobile SDK returns DIDs for subjects.
DID (did) association process can be found here.

When a host application would like to link a user with existing

A credential is a collection of data about a person. It's issued by a company (i.e. created and sent to a user) and stored in the company's app, on that user's device.
Example: ACME Bank issues a KYC verification credential to Richard (an ACME user). This includes Richard's contact information and account numbers, as well as a level of confidence in the accuracy of the data.
Components: A company issues credentials using the Server SDK, and an app stores credentials using the Mobile SDK.
credentials, the user
A DID (or decentralized identifier) identifies a participant in the Unum ID ecosystem. A participant is an issuer, subject, or verifier.
Example: ACME Bank is identified by two DIDs, one for acting as an issuer and another for acting as a verifier. Richard, an ACME subject (user), is identified by one DID. Hooli FinTech, which acts as a verifier, is identified by one DID.
Components: The Server SDK returns DIDs for issuers and verifiers, and the Mobile SDK returns DIDs for subjects.
DID (did) association flow can be kicked off. This will require the userCode and the
An issuer is a role a company can play to issue credentials to subjects (users). An issuer also change credential statuses, for example to revoke credentials.
Example: ACME Bank issues a KYC verification credential to Richard (an ACME user). It later revokes that credential and issues a new one to Richard to update his information.
Components: An issuer issues credentials and changes credential statuses using the Server SDK.
issuer
A DID (or decentralized identifier) identifies a participant in the Unum ID ecosystem. A participant is an issuer, subject, or verifier.
Example: ACME Bank is identified by two DIDs, one for acting as an issuer and another for acting as a verifier. Richard, an ACME subject (user), is identified by one DID. Hooli FinTech, which acts as a verifier, is identified by one DID.
Components: The Server SDK returns DIDs for issuers and verifiers, and the Mobile SDK returns DIDs for subjects.
DID (did) to be passed. An optional value for the user email can be passed to help prefill data. An optional value of a color hex string can also be passed to help match the color of title bar with the app theme.

/**
* Method for launching the web wallet and performing the user DID association flow.
* @param userCode: String The issuer created user code.
* @param issuerDid: String The current issuer DID.
* @param userEmail:String An optional value of the current user email to prefill the email input.
* @param context: Context A provided context to launch the chrome activity.
* @param toolBarColor: String An optional value to set the color of the chrome tool bar. This should be in hex form "#202020".
*/
WebWallet.associate(userCode, issuerDid, userEmail, context, toolBarColor)

Opening a web wallet web auth window

If the host app already has the full url required for loading the Unum ID wallet in the browser, the url can be passed to the WebWallet SDK to open a chrome browser window to that URL. An optional value of a color hex string can also be passed to help match the color of title bar with the app theme.

/**
* Method for launching a provided url in a chrome custom tab.
* @param url:String The url to be launched.
* @param context: Context A provided context to launch the chrome activity.
* @param toolBarColor: String An optional value to set the color of the chrome tool bar. This should be in hex form "#202020".
*/
WebWallet.launch(url, context, toolBarColor)