Step 2. Configure connection properties
There are two projects in this tutorial that require configuration:
- Client ReactJS app
-
The front-end client app, written in React, that handles the UI and authentication journeys.
- Backend API server
-
A backend REST API server that uses a confidential OAuth 2.0 client to contact the authorization server. The API server handles storage and retrieval of your personal "Todo" items.
Configure the React client app
Copy the .env.example
file in the sdk-sample-apps/javascript/reactjs-todo
folder and save it with the name .env
within this same directory.
Add your relevant values to this new file because it provides all the important configuration settings to your applications.
.env
fileAM_URL=https://openam-forgerock-sdks.forgeblocks.com/am
API_URL=http://localhost:9443
DEBUGGER_OFF=true
DEVELOPMENT=true
JOURNEY_LOGIN=sdkUsernamePasswordJourney
JOURNEY_REGISTER=Registration
REALM_PATH=alpha
WEB_OAUTH_CLIENT=sdkPublicClient
PORT=9443
REST_OAUTH_CLIENT=sdkConfidentialClient
REST_OAUTH_SECRET=ch4ng3it!
Here are descriptions for some of the values:
DEBUGGER_OFF
-
Set to
true
, to disabledebug
statements in the app.These statements are for learning the integration points at runtime in your browser.
When you open the browser’s developer tools, the app pauses at each integration point. Code comments are placed above each one explaining their use.
DEVELOPMENT
-
When
true
, this provides better debugging during development. JOURNEY_LOGIN
-
The simple login journey or tree you created earlier, for example
sdkUsernamePasswordJourney
. JOURNEY_REGISTER
-
The registration journey or tree.
You can use the default builtin
Registration
journey. REALM_PATH
-
The realm of your server.
Usually,
root
for AM andalpha
orbeta
for Advanced Identity Cloud.
Configure the API server app
Copy the .env.example
file in the sdk-sample-apps/javascript/todo-api
folder and save it with the name .env
within this same directory.
Add your relevant values to this new file as it will provide all the important configuration settings to your applications.
.env
fileAM_URL=https://openam-forgerock-sdks.forgeblocks.com/am
DEVELOPMENT=true
PORT=9443
REALM_PATH=alpha
REST_OAUTH_CLIENT=sdkConfidentialClient
REST_OAUTH_SECRET=ch4ng3it!