Ping SDKs

Authentication journey tutorial for Android

This tutorial guides you through creating a Ping SDK-enabled Android app from beginning to end. The app connects to a PingOne Advanced Identity Cloud tenant or PingAM server to authenticate a user using an authentication journey.

You’ll step through the user authentication journey and display the appropriate user interface, meaning you get to implement the design to your requirements.

Before you begin

Before you begin this tutorial ensure you have set up your PingOne Advanced Identity Cloud tenant or PingAM server with the required configuration.

For example, you will need an OAuth 2.0 client application set up, as well as an authentication journey for the app to navigate.

Step 1. Configure the development environment

In this step, you set up your environment to create Android applications using the freely-available Android Studio IDE.

You then create a new application project and configure it to use the Ping SDK for Android.

Step 2. Configure connection properties

In this step, you provide your application with the settings it needs to connect to your PingOne Advanced Identity Cloud or PingAM instance.

For example, which authentication tree to use, and the realm it is a part of.

Step 3. Initialize the SDK

In this step, you enable debug logging during development.

You then and add a call to the FRAuth.start() method, which initializes the SDK and loads the configuration you have defined in the previous step.

Step 4. Create a status view

In this step, you create a layout and add buttons to log in and log out your user, as well as a text view field to show their current authentication status.

You also add the code to update the value displayed in the text view.

Step 5. Add login and logout calls

In this step, you update the app with the NodeListener interface, which manages the client side of the authentication journey.

Step 6. Create UI to handle the callbacks

In this step, you add a UI fragment to obtain credentials from the user, and code to open that fragment when the callback is received.

You also add code to populate the callback with the credentials and return it to the server, completing the authentication journey.

Step 7. Test the app

In this step, you will test your application.

You run it in the emulator or on your Android device, perform authentication with a demo user, check the log for success messages, and then log out the user.