Auth0 OpenID Connect Authentication Example

WunderGraph supports OpenID Connect as authentication mechanism. Auth0 is a popular and easy to use OpenID Connect provider.

This example shows how to use Auth0 and WunderGraph together.

Setup

First, let's set up the project from a template:

1
2
3
npx create-wundergraph-app my-project -E auth0-oidc-authentication
cd my-project
npm install

Configure Auth0

  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 .example.env file to .env
  5. Paste the credentials into the .env file
  6. Set the Callback URL on Auth0 to http://localhost:9991/auth/cookie/callback/auth0

Start the project

1
npm run start

That's it! Next, you can check out the pages/index.tsx to see how the integration works.

Learn more

Deploy to WunderGraph Cloud

The easiest way to deploy your WunderGraph app is to use WunderGraph Cloud.

Deploy to WunderGraph

Was this article helpful to you?
Provide feedback

Edit this page