Github authentication redirect error

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

2 Likes

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

Did you follow this guide to setup your GitHub login?

4 Likes

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.

3 Likes

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:

4 Likes