bjabu / auth0-react-sample

React project that defines a Single-Page Application (SPA)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Easy User Authentication for React Apps

This repository hosts a React project that defines a Single-Page Application (SPA). You'll secure access to some of its routes using Auth0 User Authentication.

Get Started

Install the client project dependencies:

yarn

Create .env file under the project directory:

touch .env

Populate .env as follows:

REACT_APP_AUTH0_DOMAIN=
REACT_APP_AUTH0_CLIENT_ID=
REACT_APP_AUDIENCE=
REACT_APP_API_URL=http://localhost:7000

Get the values for REACT_APP_AUTH0_DOMAIN and REACT_APP_AUTH0_CLIENT_ID from your Auth0 Application in the Auth0 Dashboard.

The value of REACT_APP_AUDIENCE is the Auth0 Identifier of the secured API that you want to access from your React app.

For this application, you can use the Auth0 Express Sample to practice making API calls.

Run the client project:

yarn start

About

React project that defines a Single-Page Application (SPA)


Languages

Language:JavaScript 83.3%Language:HTML 10.2%Language:CSS 6.5%