Skip to content

Authenticating an AWS AppSync GraphQL API with Auth0

Notifications You must be signed in to change notification settings

kayazas123/appsync-auth0

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Authenticating AWS AppSync with Auth0

This repo goes along with the Medium blog post Authenticating an AWS AppSync GraphQL API with Auth0.

To use this repo, you must have the following credentials:

  1. An Auth0 API configured with RS256 signing algorithm for both general & OAuth signing.
  2. AWS AppSync API configured with your Auth0 app domain.

Getting started

  1. Clone the repo
git clone https://github.com/dabit3/appsync-auth0.git
  1. Change into the new directory
cd appsync-auth0
  1. Install dependencies
npm i
# or
yarn
  1. Update the AppSync graphqlEndpoint in AppSync.js with your AppSync endpoint.

  2. In App.js, configure the call to Auth0 with your credentials:

this.auth0 = new auth0.WebAuth({
  domain: '<YOURAPPDOMAIN>.auth0.com',
  clientID: '<YOURCLIENTID>',
  redirectUri: 'http://localhost:3000/callback',
  audience: 'https://<YOURAPPDOMAIN>.auth0.com/userinfo',
  responseType: 'token id_token',
  scope: 'openid'
});
  1. Run the app
npm start

About

Authenticating an AWS AppSync GraphQL API with Auth0

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 79.5%
  • HTML 16.1%
  • CSS 4.4%