Skip to content

weilyuwang/Auth0-React-Client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Easy User Authentication for React Apps

Reference: https://auth0.com/blog/complete-guide-to-react-user-authentication/

Worked as the front end client of https://github.com/weilyuwang/Auth0-SpringBoot-API

Get Started

Install project dependencies:

yarn

Run the project:

yarn start

Front End React

  • Create a SPA application (React) under Applications from Auth0

  • Create .env file in the root directory (for React frontend)

REACT_APP_AUTHO_DOMAIN=
REACT_APP_AUTH0_CLIENT_ID=

Node Backend

  • Create an API under APIs from Auth0

  • Create .env file under /server folder (for Node backend)

API_PORT=
AUTH0_AUDIENCE='https://spring.api'
AUTH0_ISSUER=

Also add the following to .env file in the root directory

REACT_APP_AUTH0_AUDIENCE='https://spring.api'

And update the React auth0 config file accordingly:

  ...

  const audience = process.env.REACT_APP_AUTH0_AUDIENCE;

  ...

  return (
    <Auth0Provider
      ...
      audience={audience}
    >
      {children}
    </Auth0Provider>
  );

About

React client with Auth0 authentication

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published