Orchestration SDKs

Step 2. Configure connection properties

PingOne Advanced Identity Cloud Android


In this step, you configure the kotlin-oidc sample to connect to the OAuth 2.0 application you created in PingOne Advanced Identity Cloud, using OIDC sign-on.

  1. In Android Studio, open the sdk-sample-apps/android/kotlin-oidc project you cloned in the previous step.

  2. In the Project pane, switch to the Android view.

  3. In the Android view, navigate to oidc > kotlin+java > com.pingidentity.samples.oidc.app, and open CentralizeLoginViewModel.kt.

  4. Locate the OidcWeb object and update with the values from your PingOne Advanced Identity Cloud tenant:

    val web by lazy {
        OidcWeb {
            logger = Logger.STANDARD
            module(Oidc) {
                clientId = "sdkPublicClient"
                discoveryEndpoint = "https://openam-forgerock-sdks.forgeblocks.com/am/oauth2/realms/alpha/.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 PingOne Advanced Identity Cloud.

    For example, sdkPublicClient

    discoveryEndpoint

    The .well-known endpoint from your PingOne Advanced Identity Cloud tenant.

    How do I find my PingOne Advanced Identity Cloud .well-known URL?

    You can view the .well-known endpoint for an OAuth 2.0 client in the PingOne Advanced Identity Cloud admin console:

    1. Log in to your PingOne Advanced Identity Cloud administration console.

    2. Click Applications, and then select the OAuth 2.0 client you created earlier. For example, sdkPublicClient.

    3. 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-known is formed as follows:

    https://<custom-domain-fqdn>/.well-known/openid-configuration

    scopes

    The scopes you added to your OAuth 2.0 application in PingOne Advanced Identity Cloud.

    For example, openid profile email address

    redirectUri

    The redirect_uri as 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

  5. Save your changes.