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 earlier, create a .env.js
file within the project, using the .env.js.template
as a source. 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
.
.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 API_PORT = 8080; // Required; default port is 8080
const API_BASE_URL = 'http://localhost'; // Required; default domain is http://localhost
const DEBUGGER_OFF = true;
const REALM_PATH = 'alpha'; // Required
const REST_OAUTH_CLIENT = 'sdkPublicClient';
const REST_OAUTH_SECRET = '';
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
andAPI_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 thedebugger
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
, orbravo
). REST_OAUTH_CLIENT
andREST_OAUTH_SECRET
-
We will use these values in a future part of this series, so any string value will do.