Ping SDKs

Step 3. Configure connection properties

In this step, you configure the sample app to connect to the authentication tree/journey you created when setting up your server configuration.

Using the server settings from above, edit the .env.js file within the project. This can be found the root folder of the project.

Add your relevant values to configure all the important server settings in the project. Not all variables will need values at this time.

You can list the file in the Terminal by doing ls -a, and edit it using a text editor like nano or vi.

Example .env.js file
/**
 * Avoid trailing slashes in the URL string values below.
 */
const AM_URL = 'https://openam-forgerock-sdks.forgeblocks.com/am'; // Required; enter _your_ PingAM URL
const DEBUGGER_OFF = true;
const DEVELOPMENT = true;
const API_URL = 'https://api.example.com:9443'; // (your resource API server's URL)
const JOURNEY_LOGIN = 'sdkUsernamePasswordJourney'; // (name of journey/tree for Login)
const JOURNEY_REGISTER = 'Registration'; // (name of journey/tree for Register)
const SEC_KEY_FILE = './updatedCerts/api.example.com.key';
const SEC_CERT_FILE = './updatedCerts/api.example.com.crt';
const REALM_PATH = ''; //Required (ex: alpha)
const REST_OAUTH_CLIENT = ''; // (name of private OAuth 2.0 client/application)
const REST_OAUTH_SECRET = ''; // (the secret for the private OAuth 2.0 client/application)
const WEB_OAUTH_CLIENT = 'sdkPublicClient'; // (the name of the public OAuth 2.0 client/application)
const PORT = '9443';

Descriptions of relevant values:

AM_URL

The URL that references PingAM itself (for PingOne Advanced Identity Cloud, the URL is likely https://<tenant-name>.forgeblocks.com/am).

API_PORT and API_BASE_URL

These just need to be "truthy" (not 0 or an empty string) right now to avoid errors, and we will use them in a future part of this series.

DEBUGGER_OFF

When true, this disables the debugger statements in the JavaScript layer. These debugger statements are for learning the integration points at runtime in your browser. When the browser’s developer tools are open, the app pauses at each integration point. Code comments above each integration point explain its use.

REALM_PATH

The realm of your server (likely root, alpha, or bravo).

REST_OAUTH_CLIENT and REST_OAUTH_SECRET

We will use these values in a future part of this series, so any string value will do.