Always getting a redirect_uri_mismatch error from GitHub

I’m using the auth0/auth0-spa-js library in my React application and have followed the getting started tutorial.

When using just the database connection with an email and password for logging in the auth flow works just fine. But when I try to use the GitHub connection my auth is failing and I only get this redirect_uri_mismatch error passed along in the query params after redirecting back to my page. I have confirmed that all of my redirect uri values in my app, auth0 and github match. Anyone else having this issue? HAR file attached.

Any help is appreciated :pray:localhost.har (3.6 MB)

In addition to the above, I just downloaded and ran the sample app from the getting started docs and am running into the same issue. Email login is working as expected, but using GitHub fails and returns the redirect_uri_mismatch error.

In case it’s an issue with my settings in auth0 or GitHub, here are some screenshot of both.

Auth0 Settings

GitHub Settings
github-Oauth-app

Did you ever find a solution to this? Running into the same exact issue myself.

Same issue here! Email works fine, but github does not.

Auth0 App callback: https://spendless.io/callback/
Github OAuth App callback: https://spendless.io/callback/

Application Type: Single Page Application
(followed this tutorial https://auth0.com/blog/securing-gatsby-with-auth0/)
gatsby 2.19.12
auth0-js 9.12.2

Same error when trying to login to both the app and the “Try It” button in manage.auth0.com/dashboard/us/*******/connections/social

https://spendless.io/callback/?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch&state=Z*************

Having the exact same issue. Has anybody figured this one yet?

Was running into this issue as well. Turns out the callback URL Github was looking for is https://[AUTH0_TENANT].auth0.com/login/callback, NOT the callback URL declared in my Auth0 dashboard.

1 Like

Thanks for sharing that solution @avelasco920!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.