Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smerth/securing-react-applications-with-auth0
How to set up 0Auth authentication using JWT tokens and Auth0 as a service for an ExpressJS server and ReactJS Client
https://github.com/smerth/securing-react-applications-with-auth0
auth0 axios create-react-app express-js json-web-token react
Last synced: 17 days ago
JSON representation
How to set up 0Auth authentication using JWT tokens and Auth0 as a service for an ExpressJS server and ReactJS Client
- Host: GitHub
- URL: https://github.com/smerth/securing-react-applications-with-auth0
- Owner: smerth
- Created: 2019-01-11T19:07:21.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T20:57:43.000Z (about 2 years ago)
- Last Synced: 2024-11-15T02:24:09.303Z (3 months ago)
- Topics: auth0, axios, create-react-app, express-js, json-web-token, react
- Language: JavaScript
- Homepage:
- Size: 2.76 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React - Securing Applications with Auth0
This project demonstrates how to set up 0Auth authentication with the Auth0 service. The app is comprised of an ExpressJS server which makes use of JWT to manage authentication tokens. The client implements Auth0 session authentication.
![App Screenshot](https://raw.githubusercontent.com/smerth/securing-react-applications-with-auth0/master/screenshot.png)
## Setup and installation
### App and dependancies
- clone the repository
- install server dependancies```bash
yarn install
```- install client dependancies
```bash
yarn install
```### Secrets
To authenticate with Auth0 you will need to set up an account. You will need to copy you credentials into the Auth folder
@ src/Auth/ create file:
```bash
touch auth0-variables.js
```Add a variables object:
@ src/Auth/auth0-variables```javascript
export const AUTH_CONFIG = {
domain: "YOUR-DOMAIN",
clientId: "YOUR-CLIENT-ID",
callbackUrl: "YOUR-CALLBACK-URL",
apiUrk: "YOUR-API-URK"
};
```## Run Server and Client
```bash
yarn start
```## Build Notes
See the docs folder for notes about building the server and app.