Step 2. Configure connection properties
PingFederate Android
In this step, you configure the kotlin-oidc sample to connect to the OAuth 2.0 application you created in PingFederate, using OIDC sign-on.
-
In Android Studio, open the
sdk-sample-apps/android/kotlin-oidcproject you cloned in the previous step. -
In the Project pane, switch to the Android view.
-
In the Android view, navigate to oidc > kotlin+java > com.pingidentity.samples.oidc.app, and open
CentralizeLoginViewModel.kt. -
Locate the
OidcWebobject and update with the values from your PingFederate tenant:val web by lazy { OidcWeb { logger = Logger.STANDARD module(Oidc) { clientId = "sdkPublicClient" discoveryEndpoint = "https://pingfed.example.com/.well-known/openid-configuration" scopes = mutableSetOf("openid", "email", "address", "profile") redirectUri = "com.example.demo://oauth2redirect" } } }- clientId
-
The client ID from your OAuth 2.0 application in PingFederate.
For example,
sdkPublicClient - discoveryEndpoint
-
The
.well-knownendpoint from your PingFederate tenant.How do I form my PingFederate .well-known URL?
To form the
.well-knownendpoint for a PingFederate server:-
Log in to your PingFederate administration console.
-
Navigate to .
-
Make a note of the Base URL value.
For example,
https://pingfed.example.comDo not use the admin console URL. -
Append
/.well-known/openid-configurationafter the base URL value to form the.well-knownendpoint of your server.For example,
https://pingfed.example.com/.well-known/openid-configuration.The SDK reads the OAuth 2.0 paths it requires from this endpoint.
-
- scopes
-
The scopes you added to your OAuth 2.0 application in PingFederate.
For example,
"openid", "email", "address", "profile", "phone" - redirectUri
-
The
redirect_urias configured in the OAuth 2.0 client profile.This value must exactly match a value configured in your OAuth 2.0 client.
For example,
com.example.demo://oauth2redirect
-
Save your changes.