Configuring GitHub login for Discourse

  1. Go to https://github.com/settings/developers, then look for OAuth Apps in the left menu. Select New OAuth App. Fill in the required fields.

    Be sure to set the Callback URL to use the path /auth/github/callback at your site domain. e.g., https://discuss.example.com/auth/github/callback

  2. (Optional) Upload a logo that users will see when signing into GitHub from your site.

  3. After creating your application, you should see the Client ID and Client Secret. Enter those in the Discourse fields:

    github_client_id
    github_client_secret

That’s it!

31 Likes

TY for the update. If it’s ok to link to an external site w/ the play by play / images of each step, here it is: https://discourse.pro/t/topic/25

2 Likes

Hi! I’d like to know if it’s possible to configure GitHub login on Discourse such that it’s not done in a popup window but rather in the main browser window? Thanks!

Both /admin/site_settings/category/all_results?filter=github and discourse/ADMIN-QUICK-START-GUIDE.md at master · discourse/discourse · GitHub link to this but I found it confusing. It is not clear that the information above is for GitHub instead of your own Discourse settings. I searched for “oauth” in my Discourse. :wink:

Please add “On GitHub” as first two words in the top post. Remove the reference to a gear icon, that seems gone. Today a direct link would be https://github.com/settings/developers.

3 Likes

Gah, I cannot file an issue at Discourse’s GitHub and I am not going to join Transifex for a trivial minor one-time fix, so here it goes, please someone take it where it belongs:

In discourse/server.de.yml at master · discourse/discourse · GitHub there are two mismatches between the displayed URL and the actually linked one. The URL should be https://github.com/settings/developers in both cases.

github_client_id: "Client-ID für GitHub-Authentifizierung, registriert auf <a href='https://github.com/settings/applications/' target='_blank'>https://github.com/settings/developers</a>"
github_client_secret: "Client-Secret für GitHub-Authentifizierung, registriert auf <a href='https://github.com/settings/applications/' target='_blank'>https://github.com/settings/developers</a>"

The change should be made to discourse/server.en.yml at master · discourse/discourse · GitHub, which is what Transifex pulls from. No manual edits should be made to other language files on GitHub, as they’ll be overwritten the next time we update them from Transifex. Please submit a PR against the english server yaml file.

1 Like

Guide updated. I added the direct link, as well as updating the screenshot to match GitHub’s current UX.

2 Likes

No, this problem only exists in the german translation so the contributors at Transifex would need to be notified about it. The english version is fine: discourse/server.en.yml at master · discourse/discourse · GitHub

2 Likes

Ah, gotcha. I missed that distinction. I should be able to make that change in the German translation.

The changed has been made in Transifex. Looks like the text was updated last year, but the URL within the <a> tag was not.

4 Likes