Summary | Verifies that a user owns a given GitHub account | |
Repository Link | GitHub - discourse/discourse-github-verification: Verifies that a Discourse user is the owner of a Github account | |
Install Guide | How to install plugins in Discourse |
Features
This plugin allows users to verify that they own a given GitHub account. This is separate from login with GitHub. It simply displays the a link to a user’s GitHub account on their user card and profile.
A new tab (GitHub
) is added to user preferences. There is a button to connect your account with GitHub when the user has not connected their account yet. If the user has connected their account, they will see a link to their GitHub account and a button to disconnect their GitHub account from their Discourse profile.
If a user has a connected GitHub account, a link will be displayed on their user card and user profile
The plugin adds an admin API endpoint /github-verification/users.json
, which returns an array of all users with a connected GitHub account. The response looks like this:
[
{
"id": 1,
"username": "markvanlan",
"github_username": "markvanlan"
}
]
Configuration
Setup GitHub OAuth app
-
Follow GitHub’s instructions on creating an OAuth app. There are two important settings to configure in the OAuth app settings
-
Homepage URL - the homepage for your Discourse instance (e.g.
https://meta.discourse.org
) -
Authorization callback URL - the home for your Discourse instance plus “/github-verification” (e.g.
https://meta.discourse.org/github-verification
-
Configure Discourse settings
Settings can be found at /admin/site_settings/category/all_results?filter=discourse_github_verification
-
discourse github verification enabled - Enables the plugin by checking in the site settings panel (
/admin/site_settings/category/all_results?filter=discourse_github_verification
). -
discourse github verification client id - Client ID of your GitHub OAuth app
-
discourse github verification client secret - Client secret of your GitHub OAuth app
Caveat
This plugin does not take into account existing login with GitHub configuration. Discourse supports this by default, but the discourse-github-verification plugin does not use a site’s existing github client id
and github client secret
settings. In the case these are filled in, we could probably use them instead of duplicating the settings. The plugin also does not know if a user has already logged into Discourse with Github. It would be nice to automatically detect this.
Thank you to Sailpoint for sponsoring this work and making it open-source