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
-
In Android Studio, select Run > Run 'app'.
-
Click Log in.
The fragment dialog appears, with fields for both name and password, as well as continue and cancel buttons:
-
Enter the credentials of the demo user:
-
Name:
demo
-
Password:
Ch4ng3it!
-
-
Click Continue.
If authentication is successful, the application returns to the main screen, and displays
User is authenticated
. -
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
-
-
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
-
Update your app to handle additional supported callbacks.
-
Improve the security of your application by adding SSL pinning.
-
Add the ability to update your configuration without reinstalling the app, with dynamic configuration.
-
Offer "magic links" to your users by adding support for suspending and resuming authentication.