Go To Dashboard

Android


This guide will show you how to implement the user authentication in a android application application. For this tutorial, we will use the Android demo from GitHub and show you step by step how to run it.

Prerequisites

  • Android SDK Version >= 15
  • Build Tools Version = 28.0.0 (changeable in build.gradle)
  • Android Studio >= 3.5.2

Setup Your Dashboard

Get your credentials and whitelist your application domain as explained in this section. This is a mandatory step to successfully implement and run the demo.

Generating your SOTT:

You will need to pass a Secure Mobile OTP Token value for user registration. You can generate this in the Configuration section of your Dashboard.

To access Secure Mobile OTP Token configuration, login to your LoginRadius Dashboard account, from the left navigation panel, click the Configuration and then navigate to the API Credentials section.

Click the down arrow or anywhere within the section and Open the Secure Mobile OTP Token subsection, the below screen will appear:

Android SOTT

Start with demo

1.You can clone the demo repository on your system using below commands:

With SSH

  git clone git@github.com:LoginRadius/android-sdk.git

With https

git clone https://github.com/LoginRadius/android-sdk.git
  1. Now import demo in your Android Studio.

  2. After importing the demo project in Android Studio, there is a need to configure API Key, Site Name and SOTT. These values are initialized in MainActivity.java.

LoginRadiusSDK.Initialize init = new Initialize();
init.setApiKey(getString(R.string.api_key));
init.setSiteName(getString(R.string.site_name));
init.setSott(sott);

(a) You can configure API Key and Site Name values in the strings.xml of the demo project.

<resources>
    ....
    <string name="api_key">your loginradius api key</string>
    <string name="site_name">your loginradius sitename</string>
    ....
</resources>

(b) To configure SOTT, replace the value in the following code in MainActivity.java:

  String sott = "put your sott here";
  1. Run this application on your android studio
Java-app

Features implemented in demo

  • Login
  • Registration
  • Email Verification
  • Forgot Password
  • Reset Password

Discover More

Discover More on

How To Guides

Edit on GitHub