Set Up Your Project

The latest version of the BindID Android SDK can be downloaded from this public repo: https://search.maven.org/artifact/com.transmitsecurity/bindid. Add the SDK to your project so your application can access all the BindID functionality, as described below.

STEP 1: Add the SDK to Your Project

Add the following in the shared build.gradle file (“allprojects” scope):

...
allprojects {
...
repositories {
...
maven { url "file:///<Full path to uncompressed SDK bundle folder>" }
...
}
...

Add the following in the module build.gradle file (project scope):

...
dependencies {
...
compile ('com.ts:bindid:1.0.0@aar') { transitive=true }
...
}
...

STEP 2: Configure the SDK

You need to configure the BindID SDK with your client ID, and to work with the BindID sandbox or production environment:

To initialize the SDK, invoke the initialize() method (see API reference). The following example uses initialization parameters to set the environment as Production (see XmBindIdServerEnvironmentMode) and the client ID (generated in the BindID Admin Portal) as qL4IJvJ1kHwunrLNOGhAAVCMD39EDPWF:

XmBindIdSdk.getInstance().initialize(XmBindIdConfig.create(
applicationContext,
XmBindIdServerEnvironment.createWithMode(XmBindIdServerEnvironmentMode.Production),
"qL4IJvJ1kHwunrLNOGhAAVCMD39EDPWF"
)).addListener(object : ObservableFuture.Listener<Boolean, XmBindIdError> {
override fun onComplete(result: Boolean) {
Log.i("BID", "SDK Initialized")
}
override fun onReject(error: XmBindIdError) {
Log.e("BID", "SDK Initialize failed")
}
})

See the API documentation for information on other initialization parameters.

STEP 3: Set Up Redirection

Upon completing authentication, BindID redirects to a Redirect URI (as specified in the BindID Admin Portal). This URI is a deep link that should return to your mobile application. To create a link to your application, add an intent filter to your app manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<queries>
<intent>
<action android:name="android.support.customtabs.action.CustomTabsService" />
</intent>
</queries>
<application>
...
<activity android:name="com.ts.bindid.BindIdActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="[YOUR_HOST]"
android:scheme="[YOUR_SCHEME]" />
</intent-filter>
</activity>
...
</application>
</manifest>

where [YOUR_HOST] and [YOUR_SCHEME] should be replaced, resulting in a deep link that looks like [YOUR_SCHEME]://[YOUR_HOST] (e.g., Acme://login-result).