All Projects → dabit3 → Appsync Auth0

dabit3 / Appsync Auth0

Authenticating an AWS AppSync GraphQL API with Auth0

Programming Languages

javascript
184084 projects - #8 most used programming language

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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].