ForgeRock SDKs 3.3

Test authentication

  1. Run the application.

  2. Click the Login button to initiate the authentication process:

    User is not yet authenticated.

    AM responds with the first challenge, and the fragment displays the text fields for collecting the username and password.

  3. Enter the username and password in the text fields provided.

    User responds to username/password challenge.
  4. Click Next to submit the content of the text fields.

    The fragment onCreateView() method:

    • Retrieves the callbacks from the Node.

    • Sets the value of the callbacks to the value of the text fields.

    • Moves to the next Node, passing the process to the MainActivity class, which implements the NodeListener.

    As this is the only challenge, authentication is successful:

    User is successfully authenticated.

In the application log output under View > Tool Window > Logcat, filter the output on com.example.forgerocksdktutorial to see messages from your app. Notice the following additional points:

  • AM includes the SSO token in the response data.

  • The SDK uses the authorize endpoint along with the SSO token and exchanges it with the authorization code.

  • The request redirects to the redirect_uri. The SDK validates that information against the redirect_uri from the configuration file, and intercepts the authorization code.

  • The SDK then invokes the access_token endpoint with the authorization code, and sends the required information to the server.

  • AM returns an access token, scopes, and an ID token.

You have now created an app that can successfully authenticate using your own UI components.

Copyright © 2010-2022 ForgeRock, all rights reserved.