Skip to content

super duper simple node API using express-oauth2-jwt-bearer

Notifications You must be signed in to change notification settings

tyfrth/auth0-node-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample API using the Auth0 express-oauth2-jwt-bearer library

This is intended to work with an Auth0 frontend library sample such as auth0-react-samples in place of the existing api-server.js.

Project setup

Use npm to install the project dependencies:

npm install

Configuration

Some tweaking will need to be done to the React sample app, primarily updating ExternalApi.js with the correct apiOrigin (http://localhost:3003) and adding additional functions to call /api/external/public and /api/external/create . The "Call an API" functionality of auth0-react-samples should work with the /api/external endpoint once the port has been configured correctly. This sample runs on http://localhost:30003.

This app uses dotenv rather than auth_config.json in api-server.js. Create a .env file and add the following:

ISSUER_BASE_URL=https://{your_domain}.auth0.com
AUDIENCE=https://{your_api_identifier}

Run the sample

This starts the backend API server on port 3003.

node server.js

About

super duper simple node API using express-oauth2-jwt-bearer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published