jruusu / auth0-spa-api-demo

Quick demo of a single page web app with Auth0 login, and Backend API call with bearer token authentication

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

auth0-spa-api-demo

Quick demo of a single page web app with

  • Auth0 login
  • Backend API call with bearer token authentication

Code in this repo is mostly based on Quick Start examples by Auth0.

Prerequisites

Initial setup

  1. Set up an Auth0 account, domain, and application (type: Single Page App)
  2. From the Auth0 console, stick the Domain as AUTH0_DOMAIN and Client ID as AUTH0_CLIENT_ID in your local .env file.
  3. In Auth0 console, create an API. Select the RS256 Signing Algorithm. Stick your API Identifier as AUTH0_AUDIENCE in your local .env file.

Run it locally

heroku local web

Run it in Heroku

  1. Create a heroku app; heroku create
  2. Set AUTH0_DOMAIN, AUTH0_CLIENT_ID, and AUTH0_AUDIENCE as config vars. Instructions: Configuration and Config Vars
  3. Deploy to Heroku with Git; git push heroku master

About

Quick demo of a single page web app with Auth0 login, and Backend API call with bearer token authentication


Languages

Language:JavaScript 91.2%Language:HTML 8.8%