Ping SDKs

Step 3. Configure connection properties

In this step, you configure the sample app to connect to the OAuth 2.0 application you created in PingOne Advanced Identity Cloud.

  1. In the IDE of your choice, open the sdk-sample-apps folder you cloned in the previous step.

  2. Make a copy of the /javascript/central-login-oidc/.env.example file, and name it .env.

    The .env file provides the values used by the forgerock.Config.setAsync() method in javascript/central-login-oidc/src/main.js.

  3. Update the .env file with the details of your PingOne Advanced Identity Cloud instance.

    SCOPE="$SCOPE"
    TIMEOUT=$TIMEOUT
    WEB_OAUTH_CLIENT="$WEB_OAUTH_CLIENT"
    WELL_KNOWN="$WELL_KNOWN"
    SERVER_TYPE="$SERVER_TYPE"

    Replace the following strings with the values you obtained when preparing your environment.

    $SCOPE

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

    For example, address email openid phone profile

    $TIMEOUT

    How long to wait for OAuth 2.0 timeouts, in milliseconds.

    For example, 3000

    $WEB_OAUTH_CLIENT

    The client ID from your OAuth 2.0 application in PingOne Advanced Identity Cloud.

    For example, sdkPublicClient

    $WELL_KNOWN

    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

    $SERVER_TYPE

    Ensures the sample app uses the correct behavior for the different servers it supports, for example what logout parameters to use.

    For PingOne Advanced Identity Cloud and PingAM servers, specify AIC.

    The result resembles the following:

    .env
    SCOPE="address email openid phone profile"
    TIMEOUT=3000
    WEB_OAUTH_CLIENT="sdkPublicClient"
    WELL_KNOWN="https://openam-forgerock-sdks.forgeblocks.com/am/oauth2/alpha/.well-known/openid-configuration"
    SERVER_TYPE="AIC"