Step 3. Configure connection properties
In this step, you configure the sample app to connect to the OAuth 2.0 application you created in PingFederate.
-
In the IDE of your choice, open the
sdk-sample-apps
folder you cloned in the previous step. -
Open the
/central-login/src/main.js
file. -
Replace the
forgerock.Config.set
method with this code:await Config.setAsync({ clientId: "<PingFederate Client ID>", redirectUri: `${window.location.origin}`, scope: "address email openid phone profile", serverConfig: { wellknown: "<PingFederate .well-known URL>", }, });
Replace the following strings with the values you obtained when you registered an OAuth 2.0 application in PingFederate.
- <PingFederate Client ID>
-
The client ID from your OAuth 2.0 application in PingFederate.
For example,
sdkPublicClient
- <PingFederate .well-known URL>
-
The
.well-known
endpoint of your PingFederate server.How do I find my PingFederate .well-known URL?
You can form your
.well-known
endpoint by adding/.well-known/openid-configuration
to your server’s base URL.To view the base URL of your PingFederate server:
-
Log in to your PingFederate administration console.
-
Navigate to
. -
Make a note of the Base URL value.
For example,
https://pingfed.example.com
Do not use the admin console URL. -
Append `/.well-known/openid-configuration ` to your base URL.
For example,
https://pingfed.example.com/.well-known/openid-configuration
-
The result resembles the following:
await Config.setAsync({ clientId: "sdkPublicClient", redirectUri: `${window.location.origin}`, scope: "address email openid phone profile", serverConfig: { wellknown: "https://pingfed.example.com/.well-known/openid-configuration", }, });