Ping SDKs

Step 7. Test the app

In this step, you run and 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.

Log in as a demo user

  1. In Android Studio, select Run > Run 'app'.

  2. Click Log in.

    The fragment dialog appears, with fields for both name and password, as well as continue and cancel buttons:

    The dialog fragment with text fields and buttons.
  3. Enter the credentials of the demo user:

    • Name: demo

    • Password: Ch4ng3it!

  4. Click Continue.

    If authentication is successful, the application returns to the main screen, and displays User is authenticated.

  5. Open the Logcat pane.

    If authentication was successful, the log contains entries similar to the following:

    [4.6.0] [AuthServiceResponseHandler]: Journey finished with Success outcome.
    [4.6.0] [AuthServiceResponseHandler]: SSO Token received.

    If authentication fails:

    • Check the credentials you are using are correct.

      For example, attempt to log directly into your ID Cloud or PingAM instance using them.

    • Check your strings.xml has the correct values for your environment

  6. Click the Log out button.

    If logout is successful, the application displays User is not authenticated.

    The Logcat pane contains entries similar to the following:

    [4.6.0] [OAuth2ResponseHandler]: Revoke success
    [4.6.0] [DefaultTokenManager]: Revoking AccessToken & Refresh Token Success

You have successfully completed the tutorial.

Next Steps