android-appauth-sample-application is a basic sample application to demonstrate native application single sign-on using the AppAuth library for Android from the OpenID Foundation.
This sample application is based on the "example" in the AppAuth reference libraries and will authenticate the user and present the user's subject and tokens on the screen. Options to refresh the OAuth 2.0 access token and to refresh the authentication session are also demonstrated.
Refer to the Mobile Application SSO Developers Guide for more detailed information.
Note: You can get developer licenses and the PingFederate software at https://developer.pingidentity.com/get-started
This sample application has been built using PingFederate 8.0.1 and the OAuth Playground 3.2. Follow the documentation for PingFederate and the OAuth Playground to quickly stand up an OpenID Connect Provider / OAuth Authorization Server.
- PingFederate server & license (download developer software and licenses)
- OAuth Playground (available from product downloads)
- AppAuth library for Android
- Open this project (android-appauth-sample-application) in Android Studio
- Add the AppAuth library for Android project to your XCode project
- File > Project Structure > '+' > Import Gradle Project (browse to the AppAuth library)
- Clean up any dependencies (i.e. comment out com.jfrog.bintray if you don't use bintray)
- Add the library as a dependency (File > Project Structure > app > Dependencies ('+ Module dependency')
- Modify the MainActivity.java file to define your PingFederate server, your client_id and redirect_uri
- Modify the strings.xml file to define the redirect scheme for the Intent
- Install PingFederate and the OAuth Playground (see the readme in the OAuth Playground distribution)
- Modify the OAuth client "ac_client" in the PingFederate configuration:
- OAuth Settings -> Client Management -> ac_client
- Edit the "Redirect URIs" option to include the application callback URI (com.pingidentity.developer.appauth://oidc_callback)
This software is open sourced by Ping Identity but not supported commercially as such. Any questions/issues/comments should be directed to the "Developer Q&A" group in the Ping Identity Support Communities https://community.pingidentity.com/collaborate.