ForgeRock Developer Experience

Android tutorials

To complete these tutorials successfully, you should perform the following prerequisite tasks.

Configure your server

Select your server environment below for instructions on creating the necessary configuration to successfully complete these tutorials:

Tutorial steps

There are two tutorials available for Android, depending on your server environment:

ForgeRock logo

This tutorial guides you through creating a ForgeRock SDK-enabled Android app from beginning to end.

It uses embedded login to implement user authentication journeys, meaning you get to design and implement the user interface to your requirements.

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 ForgeRock SDK for Android.

Step 2. Configure connection strings

In this step, you provide your application with the settings it needs to connect to your ForgeRock Identity Cloud or AM 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.

PingIdentity logo

Configure a sample Android app to launch a browser to authenticate your users in PingOne, using centralized login.

After authenticating, PingOne redirects users back to your sample client application, that can then get OAuth 2.0 tokens and user info for the user.

Step 1. Download the ForgeRock SDK for Android

In this step, you download the ForgeRock SDK for Android repo, which contains the projects you will use.

Step 2. Configure the sample app

In this step, you configure the "app" sample to connect to the OAuth 2.0 application you created in PingOne, using the centralized login method.

Step 3. Run the sample app and perform centralized login

In this final step, you run the sample app that you configured in the previous step.

The app performs a centralized login on your PingOne instance.

Copyright © 2010-2024 ForgeRock, all rights reserved.