Skip to content

Latest commit

 

History

History

auth0-oidc-authentication

WunderGraph Example with Auth0 OpenID Connect Authentication

Getting Started

1. Get Auth0 credentials:

  1. Go to Auth0 and create a new application of type "Regular Web Application"
  2. Skip the Quickstart
  3. Copy the Issuer, Client ID and Client Secret to the clipboard
  4. Rename the .env.example file to .env
  5. Paste the credentials into the .env file
  6. Set Allowed Callback URLs on Auth0's app settings dashboard to http://localhost:9991/auth/cookie/callback/auth0
  7. Set Allowed Logout URLs on Auth0's app settings dashboard to http://localhost:3000

2. Install & Start

  1. Copy the .env.example file to .env and fill in the required values.
  2. Install the dependencies and run the complete example in one command:
npm install && npm start

3. Use the application

On the NextJS frontend, click the "Login" button. Once the login is complete, the Frontend will automatically fetch the data and inject the bearer token into the origin request.

Learn More

Read the Docs.

Deploy to WunderGraph Cloud

Deploy to WunderGraph

Got Questions?

Join us on Discord!