Introduction

The biid Auth SDK is the easiest way to integrate authentication via the biid App in an Android app. The biid Auth SDK library contains a biid Client. This client communicates with the biid App and the biid Identity Service.

The developers guide describes how to integrate the biid Auth SDK library and use the biid Client. For further details please check the javadoc.

Integration

Include the biid Auth SDK library as a dependency in your Android project:

repositories {

    ...

    maven {
        url "http://nexus.biid.com/content/repositories/client-releases"
    }

    ...
}

dependencies {

    ...

    compile ('com.biid:sdk-auth-android:3.0.60'){transitive=true}

    ...
}

biid will provide you with a manifest file. Place this file in the assets directory of your Android project.

Your app will need the following permission:

    <uses-permission android:name="com.biid.sdk.core.android.permission.PUBLIC_KEY_SERVICE" />

Get a reference to the biid Client like this:

AuthClient client = Sdk.getClient();

The first call to the client must be

client.initialize(context);

Authentication via the biid App

Start the authentication flow with

client.startAuthentication(this, entityAuthApp);

The entityAuthApp references the entity and authenticator app used for the authentication flow.

The authenticator app will ask the user for their credentials. Handle the result of the authentication flow as follows:

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {

        ...

        if (client.onAuthenticationResult(this, requestCode, resultCode, data)) {
            // authentication was successful
        } else {
            // this is not a result of the authentication flow
        }

        ...
    }