# Sample React SPA By following this guide, you will be able to deploy a React single-page application (SPA) locally and secure it with OpenID Connect. ## Prerequisites - **npm with Node.js** If you don't have it, [install npm and node](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm){target="_blank"} in your local environment. - **A user account in the {{ product_name }}** If you don't already have one, create a user account in the {{ product_name }}. ## Register the app Follow the steps given below to register the sample React SPA in the {{ product_name }}. 1. On the {{ product_name }} Console, go to **Applications**. 2. Click **New Application** and select **Single-Page Application** 3. Enter the following details: {: width="700" style="display: block; margin: 0; border: 0.3px solid lightgrey;"}
| Name | Give a unique name to identify your application. |
| Authorized redirect URLs |
The URL to which the user is redirect to after a successful login. Use the following URL for this sample app: https://localhost:3000
|
| Allow sharing with organizations | Enable this to share the new application with all or any selected B2B organizations that belong to your primary organization. |
https://localhost:3000).
The access URL is used,
- in the application catalog and discovery flows.
- to redirect the user back to the application in the following scenarios.
- if the login page times out
- after a password reset
- after the self sign-up verification
- to re-initiate the login flow if the login flow fails.
## Download the sample
Click the button below to download the sample. You can also choose to view the source before doing so.
## Configure the sample
Follow the steps given below to configure the sample app.
1. Unzip the application folder.
2. Go to the `asgardeo-react-app/src/` folder and open the `config.json` file in a text editor.
3. Update the following in the `config.json` file:
```json
{
"clientID": "{client ID}",
"baseUrl": "https://localhost:9443",
"signInRedirectURL": "https://localhost:3000",
"signOutRedirectURL": "https://localhost:3000",
"scope": [ "profile" ]
}
```
| Configuration | Description |
|---|---|
clientID
|
The client id that you received when you registered the application in the {{ product_name }}. |
baseUrl
|
All authentication requests that the client application makes to the {{ product_name }} will be appended to this base URL.: https://localhost:9443
|
scope
|
The list of OIDC scopes that are used for requesting user information. You can add OIDC scopes such as "scope": ["profile", "email"]
Learn more about [OIDC scopes in the {{ product_name }}]({{base_path}}/guides/users/attributes/manage-scopes/). |