---
title: Step 3. Configuring connection properties
description: Create a .env file in PingSampleApp and configure the server URL, OAuth 2.0 client ID, redirect URI, and other connection properties.
component: orchsdks
page_id: orchsdks:journey:try-it-out/react-native/03_configure_sample
canonical_url: https://developer.pingidentity.com/orchsdks/journey/try-it-out/react-native/03_configure_sample.html
llms_txt: https://developer.pingidentity.com/orchsdks/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
keywords: ["PingOne Advanced Identity Cloud", "PingAM", "Journeys", "Setup &amp; Configuration", "Source Code", "Tutorial", "SDK", "React Native"]
section_ids:
  creating_the_environment_file: Creating the environment file
---

# Step 3. Configuring connection properties

[icon: circle-check, set=far]PingOne Advanced Identity Cloud [icon: circle-check, set=far]PingAM [icon: react, set=fab]React Native

* [Prepare](00_before-you-begin.html)

* [Download](01_download_samples.html)

* [Install](02_prepare-projects.html)

* **Configure**

* [Run](04_run_the_sample.html)

In this step, you configure the `PingSampleApp` to connect to your PingOne Advanced Identity Cloud or PingAM instance.

All connection settings are stored in a `.env` file in the `PingSampleApp` directory. The app reads this file at build time.

## Creating the environment file

1. In a terminal, navigate to the `PingSampleApp` directory:

   ```shell
   cd PingSampleApp
   ```

2. Copy the example environment file:

   ```shell
   cp .env.example .env
   ```

3. Open `.env` in a text editor and update the values to match your environment:

   Example values in the .env file

   ```shell
   JOURNEY_SERVER_URL=https://openam-forgerock-sdks.forgeblocks.com/am
   JOURNEY_REALM=alpha
   JOURNEY_COOKIE=ch15fefc5407912
   JOURNEY_CLIENT_ID=sdkPublicClient
   JOURNEY_DISCOVERY_ENDPOINT=https://openam-forgerock-sdks.forgeblocks.com/am/oauth2/realms/alpha/.well-known/openid-configuration
   JOURNEY_REDIRECT_URI=com.example.demo://oauth2redirect
   JOURNEY_SCOPES=openid, email, address, profile
   ```

   * *JOURNEY\_SERVER\_URL*

     The base URL of the server, including the deployment path.

     *PingOne Advanced Identity Cloud example*:

     `https://openam-forgerock-sdks.forgeblocks.com/am`

     *PingAM example*:

     `https://openam.example.com:8443/openam`

   * *JOURNEY\_REALM*

     The realm in which the OAuth 2.0 client and authentication journeys are configured.

     Typically `root` for AM and `alpha` or `bravo` for Advanced Identity Cloud.

   * *JOURNEY\_COOKIE*

     The name of the cookie used for the session token.

     For example, with a self-hosted PingAM server this value might be `iPlanetDirectoryPro`.

     |   |                                                                                                                                                                                                                                                      |
     | - | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     |   | PingOne Advanced Identity Cloud tenants use a random alphanumeric string.To find the cookie name in an PingOne Advanced Identity Cloud tenant, navigate to **Tenant settings** > **Global Settings**, and copy the value of the **Cookie** property. |

   * *JOURNEY\_CLIENT\_ID*

     The client ID of the OAuth 2.0 application you registered in PingOne Advanced Identity Cloud or PingAM.

     For example, `sdkPublicClient`

   * *JOURNEY\_DISCOVERY\_ENDPOINT*

     The `.well-known` OpenID Connect discovery endpoint for your server.

     > **Collapse: How do I find my PingOne Advanced Identity Cloud  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`
     >
     > |   |                                                                                                                                                                                                                                                                                                                                 |
     > | - | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     > |   | If you are using a custom domain, your `.well-known` is formed as follows:`https://<custom-domain-fqdn>/.well-known/openid-configuration`Learn more in [Access OIDC configuration discovery endpoint](https://docs.pingidentity.com/pingoneaic/latest/realms/custom-domains.html#access-oidc-configuration-discovery-endpoint). |

     > **Collapse: How do I find my PingAM  URL?**
     >
     > To form the `.well-known` URL for an PingAM server, concatenate the following information into a single URL:
     >
     > 1. The base URL of the PingAM component of your deployment, including the port number and deployment path.
     >
     >    For example, `https://openam.example.com:8443/openam`
     >
     > 2. The string `/oauth2`
     >
     > 3. The hierarchy of the realm that contains the OAuth 2.0 client.
     >
     >    You must specify the entire hierarchy of the realm, starting at the Top Level Realm. Prefix each realm in the hierarchy with the `realms/` keyword.
     >
     >    For example, `/realms/root/realms/customers`
     >
     >    |   |                                                                                 |
     >    | - | ------------------------------------------------------------------------------- |
     >    |   | If you omit the realm hierarchy, the top level `ROOT` realm is used by default. |
     >
     > 4. The string `/.well-known/openid-configuration`
     >
     > For example, `https://openam.example.com:8443/openam/oauth2/realms/root/.well-known/openid-configuration`

     For example, `https://openam-forgerock-sdks.forgeblocks.com/am/oauth2/realms/alpha/.well-known/openid-configuration`

   * *JOURNEY\_REDIRECT\_URI*

     The redirect URI configured in your OAuth 2.0 client profile.

     This value must exactly match a redirect URI registered in your server.

     For example, `com.example.demo://oauth2redirect`.

     |   |                                                                                                                                                                                                                                                                                                                                              |
     | - | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
     |   | The default redirect scheme registered in the sample app is `org.forgerock.demo`.If you use a different scheme, you must also update `manifestPlaceholders["appRedirectUriScheme"]` in `PingSampleApp/android/app/build.gradle` (Android) and the `CFBundleURLSchemes` entry in `PingSampleApp/ios/PingSampleApp/Info.plist` (iOS) to match. |

   * *JOURNEY\_SCOPES*

     A comma-separated list of OAuth 2.0 scopes to request.

     For example, `openid, email, address, profile`

With the environment file configured, the React Native app will pick up your settings the next time you build and run it.
