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
Configure Auth0
- Go to Auth0 and create a new application of type "Regular Web Application"
- Skip the Quickstart
- Copy the Issuer, Client ID and Client Secret to the clipboard
- Rename the .example.env file to .env
- Paste the credentials into the .env file
- Set the Callback URL on Auth0 to
http://localhost:9991/auth/cookie/callback/auth0
Start the project
1
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.