Github authentication redirect error

AI-generated summary

iamtunde reported a GitHub authentication redirect error on their Discourse installation, receiving a 404 with a redirect_uri_mismatch error after clicking the GitHub login button. The URL showed the callback was incorrectly set to https://MYDOMAIN/auth/oauth2_basic/callback. osioke suggested reviewing the official guide on configuring GitHub login. iamtunde later resolved the issue by changing the callback URL from https://mydomain/auth/callback/github to https://mydomain/auth/github, noting the guide may need updating. osioke responded that the guide actually recommends https://discuss.example.com/auth/github/callback, and since the issue was resolved, they closed the thread. The discrepancy between the guide and the fix suggests potential confusion in documentation or configuration context.

Hello Friends, a friendly newbie here.

I have this problem with configuring login with Github on my discourse installation, after providing the necessary API keys required in the Admin > Settings > Login page in the github setup section.

Clicking on the Github login option redirects to a 404 page and returns the screenshot below.

and this in the URL bar
https://MYDOMAIN/auth/oauth2_basic/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=29b1f640d906a3bf4d92a1fe5846af740eea49adbfbfb65c

Hello Tunde, nice to see you here :slight_smile: :wave:

Did you follow this guide to setup your GitHub login?

Hi Osioke, thank you for your reply.

I did follow the guide and still couldn’t get it fixed, I eventually found a fix on my own.

Apparently the callback URL from the guide isn’t quite correct, I changed it from https://mydomain/auth/callback/github to https://mydomain/auth/github and everything works well.

Perhaps the guide should be updated for future readers.

Glad you were able to sort it out, interestingly, the guide uses the same URL you shared:

So we are good here.

Seeing as you mentioned you were able to resolve it and you found a fix:

I’ll be closing this off now. Cheers! :slight_smile: