% git clone git@github.com:pangeacyber/pangea-example-react-oauthn.git
% cd pangea-example-react-oauthn
% yarn install
If you don't already have an account, signup at https://console.pangea.cloud/
Create a project and enable the AuthN Service in the Pangea Console.
Important
Configure a Redirect Setting for your project in Pangea Console.
- Navigate to the
AuthNservice,General > Redirect Settings - Click
+ Redirect - Type
http://localhost:3001in the URL input and clickSave
Navigate to AuthN > OAuth Server.
- Click the
+ OAuth Clientbutton on the right. - Enter a name for the client.
- Select
Grant TypesofAuthorization Code. - Select
Response TypesofCodeandToken. - Enter an
Allowed Redirect URLofhttp://localhost:3001, and press enter. - Click Save.
Important
If the app is running on a different host or port number, the Allowed Redirect URL will need to be updated to match your setup.
Copy and note the Client ID for the OAuth Client created above. This is the CLIENT_ID used below.
Copy the the Metadata Endpoint from the OAuth Server Configuration Details. This is the METADATA_URL used below.
% cp .env.template .env.local
Set the following values in .env.local
REACT_APP_CLIENT_ID="{CLIENT_ID}"
REACT_APP_METADATA_URL="{METADATA_URL}"
% yarn start
Open http://localhost:3001 in a browser.