Configuring the Journey module on Android
PingOne Advanced Identity Cloud PingAM Android
You must configure the Journey module to connect to your Advanced Identity Cloud or PingAM server.
To configure the module, instantiate the Journey class and provide the configuration options as follows:
journey moduleval journey = Journey {
serverUrl = "https://openam-forgerock-sdks.forgeblocks.com/am" // Specify the server URL
realm = "alpha" // Specify the realm for authentication
cookie = "ch15fefc5407912" // Specify the cookie name for session management
logger = Logger.STANDARD // Optional. Logger the module uses to output messages
}
Update the following properties with values that match your environment:
- serverUrl
-
The URL of the Access Management service on your server.
- Advanced Identity Cloud example:
-
https://openam-forgerock-sdks.forgeblocks.com/am - PingAM example:
-
https://openam.example.com:8443/openam
- realm
-
The realm containing your users and configuration.
Usually,
rootfor PingAM andalphaorbravofor Advanced Identity Cloud. - cookie
-
The name of the cookie your PingOne Advanced Identity Cloud tenant uses to store SSO tokens in client browsers.
-
On a self-hosted PingAM server this value is usually
iPlanetDirectoryPro. -
On servers, the cookie name is a random string of characters, such as
ch15fefc5407912.How do I find my PingOne Advanced Identity Cloud cookie name?
To locate the cookie name in an PingOne Advanced Identity Cloud tenant:
-
Navigate to Tenant settings > Global Settings
-
Copy the value of the Cookie property.
-
-
- logger
-
The logger the module uses to output messages.
Choose from,
STANDARD,WARN, orNONE, or specify a custom logger to use.Learn more in Customizing logging on Android.
Integrating the OIDC Module
You can choose to integrate the OIDC module into your Journey module configuration, to obtain and manage OpenID Connect 1.0 tokens on behalf of the user.
To integrate the OIDC module, add the configuration when instatiating the Journey class as follows:
oidc module with the journey moduleval journey = Journey {
serverUrl = "https://openam-forgerock-sdks.forgeblocks.com/am"
realm = "alpha"
cookie = "ch15fefc5407912"
module(Oidc) {
clientId = "sdkPublicClient"
discoveryEndpoint = "https://openam-forgerock-sdks.forgeblocks.com/am/oauth2/realms/alpha/.well-known/openid-configuration"
scopes = ["openid", "email", "address"]
redirectUri = "org.forgerock.demo://oauth2redirect"
}
}
Update the following properties with values that match your environment:
- clientId
-
The client ID from your OAuth 2.0 application.
For example,
sdkPublicClient - discoveryEndpoint
-
The
.well-knownendpoint from your server.How do I find my PingOne Advanced Identity Cloud
.well-knownURL?You can view the
.well-knownendpoint for an OAuth 2.0 client in the PingOne Advanced Identity Cloud admin console:-
Log in to your PingOne Advanced Identity Cloud administration console.
-
Click Applications, and then select the OAuth 2.0 client you created earlier. For example, sdkPublicClient.
-
On the Sign On tab, in the Client Credentials section, copy the Discovery URI value.
For example,
https://openam-forgerock-sdks.forgeblocks.com/am/oauth2/alpha/.well-known/openid-configuration
If you are using a custom domain, your
.well-knownis formed as follows:https://<custom-domain-fqdn>/.well-known/openid-configurationLearn more in Access OIDC configuration discovery endpoint.
How do I find my PingAM
.well-knownURL?To form the
.well-knownURL for an PingAM server, concatenate the following information into a single URL:-
The base URL of the PingAM component of your deployment, including the port number and deployment path.
For example,
https://openam.example.com:8443/openam -
The string
/oauth2 -
The hierarchy of the realm that contains the OAuth 2.0 client.
You must specify the entire hierarchy of the realm, starting at the Top Level Realm. Prefix each realm in the hierarchy with the
realms/keyword.For example,
/realms/root/realms/customersIf you omit the realm hierarchy, the top level
ROOTrealm is used by default. -
The string
/.well-known/openid-configuration
For example,
https://openam-forgerock-sdks.forgeblocks.com/am/oauth2/realms/alpha/.well-known/openid-configuration -
- scopes
-
The scopes you added to your OAuth 2.0 application.
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