Hi @blazestudios23 ,
Welcome to the Community!
We have an FAQ that might be related to this error:
Question:
My application is getting an access_denied error at the end of the flow. Why is that?
Answer:
access_denied happens when Auth0 can’t issue a token (Auth0 refuses the authorization). It can happen for many reasons, and the error_description parameter usually provides a useful hint.
E.g.
Service not found: […some invalid audience provided in the token request…]
User has canceled the interaction.
The most common source of these errors, however, is rules or actions. E.g. if you …
Also, I found this Github issue in the nextjs-auth0 repo. In this case, the social connection did not work because of the env vars that were configured:
opened 11:43AM - 15 Jan 20 UTC
closed 08:20PM - 15 Jan 20 UTC
### Description
I am using the sample Next.js Auth0 application and I added Git… Hub authentication, but unfortunately it always returns `Unauthorized`.
### Reproduction
- `npx create-next-app --example auth0 auth`
- `cd auth0`
- `npm i`
- `cp .env.template .env`
- I have setup a GitHub Application and enabled the social connection
- Click on Login
- Select 'GitHub'
- Observe 'Unauthorized'
FYI I am *not* using a custom domain. My GitHub app settings are:
Homepage URL: `https://mytenantname.auth0.com`
Authorization callback URL: `https://mytenantname.auth0.com/api/callback`
My `.env` file:
```
AUTH0_CLIENT_ID=XXX
AUTH0_DOMAIN=mytenantname.auth0.com
AUTH0_CLIENT_SECRET=ABC
REDIRECT_URI=http://localhost:3000/api/callback
POST_LOGOUT_REDIRECT_URI=http://localhost:3000/
SESSION_COOKIE_SECRET=123
```
Please note that I have also tried to change the GitHub Application settings from the tenant name to `http://localhost:3000` and `http://localhost:3000/api/callback` but in that case I am getting the following error:
`state mismatch, expected long-random-string, got: another-long-random-string`
Plus the following message in the console: `The redirect_uri MUST match the registered callback URL for this application.`
### Environment
> Please provide the following:
- 0.6.0
- next: "latest"
- Mac/Chrome latest
Hopefully, those resources will help you get past the error!