# Configure GitHub login for Discourse

**URL:** https://meta.discourse.org/t/configure-github-login-for-discourse/13745
**Category:** Integrations
**Tags:** sso, how-to, social-auth
**Created:** [March 14, 2014, 8:47pm UTC](https://meta.discourse.org/t/configure-github-login-for-discourse/13745 "2014-03-14T20:47:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [March 14, 2014, 8:47pm UTC](https://meta.discourse.org/t/configure-github-login-for-discourse/13745/1 "2014-03-14T20:47:14Z")

</div>

> 🔖 This guide explains how to set up GitHub as a login option for your Discourse forum by configuring OAuth credentials.
> 
> 🙋 Required user level: Administrator

## Overview

GitHub login integration allows users to sign in to your Discourse site using their GitHub accounts. This provides a convenient authentication option, especially useful for developer-focused communities.

## Setting up GitHub OAuth

1. Visit GitHub’s developer settings at `https://github.com/settings/developers`

2. In the left menu, locate and click on **OAuth Apps**

3. Click **New OAuth App**

4. Fill in the required fields:

 ![GitHub OAuth App registration form](https://global.discourse-cdn.com/meta/original/4X/a/b/2/ab2b4133a0458fac605f491efa7b0235ead716df.png)

1. Click **Register application**

## Configuring Discourse settings

1. After registration, GitHub will display your **Client ID** on the app settings page.

2. To obtain a Client Secret, click **Generate a new client secret**. Copy it immediately — it will only be shown once.

3. In your Discourse admin settings, configure the following:

## Testing the integration

1. Sign out of your Discourse site
2. On the login page, you should now see a “with GitHub” login option
3. Test the login flow to ensure it works as expected

## Best practices

- Keep your Client Secret secure and never share it publicly
- Regularly review your GitHub OAuth app settings
- Consider enabling additional security features in GitHub’s OAuth app settings

## Common issues and solutions

- If login fails, verify that your callback URL exactly matches what’s configured in GitHub
- Ensure your site’s SSL certificate is valid, as GitHub requires HTTPS
- Check that both client ID and secret are correctly entered in Discourse settings

## Additional resources

- [Setup DiscourseConnect - Official Single-Sign-On for Discourse (sso)](https://meta.discourse.org/t/setup-discourseconnect-official-single-sign-on-for-discourse-sso/13045)
- [Creating an OAuth app - GitHub Docs](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app)

> Last edited by @jessii 2024-12-11T20:15:33Z
> 
> > **Check document**
> >
> > Perform check on document:
