> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev.auth0-mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Add GitHub Login to Your App

> Learn how to add Sign In with GitHub to your application using Auth0. Configure a GitHub social connection with OAuth 2.0 to let users authenticate with their GitHub accounts.

Auth0 supports sign in with GitHub, allowing your users to authenticate with their GitHub accounts through <Tooltip tip="OAuth 2.0: Authorization framework that defines authorization protocols and workflows." cta="View Glossary" href="/docs/glossary?term=OAuth+2.0">OAuth 2.0</Tooltip>. Adding GitHub as a social login option provides a fast, familiar sign-in experience for developers and technical users.

To set up this connection, you register an OAuth application in GitHub, then configure the connection in the Auth0 Dashboard using the credentials GitHub provides.

<Card title="Before you start">
  Before you configure GitHub as a social connection, you need:

  1. An [Auth0 account](https://auth0.com/signup). If you do not have one, you can sign up for free.
  2. A [GitHub account](https://github.com/signup).
  3. An application registered in the [Auth0 Dashboard](https://manage.auth0.com/#/applications).
</Card>

## Configure GitHub

Create an OAuth application in GitHub to generate the credentials Auth0 needs to establish the connection.

<Steps>
  <Step title="Open GitHub Developer Settings">
    Log in to your GitHub account. Select your profile photo in the upper-right corner, then select **Settings**. In the left sidebar, select **Developer settings**, then select **OAuth Apps**.
  </Step>

  <Step title="Register a new OAuth application">
    Select **New OAuth App**. If you have not created any applications before, select **Register a new application**.

    Complete the following fields:

    | **Field**                      | **Value**                                                                          |
    | ------------------------------ | ---------------------------------------------------------------------------------- |
    | **Application name**           | A name your users will recognize and trust, for example `My App (Auth0)`           |
    | **Homepage URL**               | The full URL to your application homepage, for example `https://myapp.example.com` |
    | **Application description**    | (Optional) A description displayed to all users of your application                |
    | **Authorization callback URL** | `https://YOUR_AUTH0_DOMAIN/login/callback`                                         |

    Replace `YOUR_AUTH0_DOMAIN` with your Auth0 tenant domain. You can find this value in [Auth0 Dashboard > Applications > Applications](https://manage.auth0.com/#/applications) under the **Settings** tab.

    You can leave **Enable Device Flow** unchecked unless your application requires device-based authorization.

    Select **Register application**.
  </Step>

  <Step title="Copy the Client ID and Client Secret">
    After registration, GitHub displays the application details page. Copy the **Client ID** value.

    Select **Generate a new client secret** to create a secret. Copy the generated value immediately.

    <Callout icon="file-lines" color="#0EA5E9" iconType="regular">
      GitHub displays the Client Secret only once. Store it securely before navigating away from the page. If you lose it, you must generate a new one.
    </Callout>
  </Step>
</Steps>

## Configure Auth0

Add the GitHub connection to your Auth0 tenant and enter the credentials from the previous section.

<Steps>
  <Step title="Create a GitHub connection">
    Navigate to [Auth0 Dashboard > Authentication > Social](https://manage.auth0.com/#/social) and select **Create Connection**. Select **GitHub** from the list of providers.
  </Step>

  <Step title="Select the connection purpose">
    Under **Purpose**, specify how this connection will be used: for login, connected accounts, or both.
  </Step>

  <Step title="Enter your GitHub credentials">
    In **General**, enter the **Client ID** and **Client Secret** you copied from GitHub.
  </Step>

  <Step title="Select permissions">
    Under **Permissions**, select the permissions your application requires. Most applications need **Email address** for the user's email and **Read user** for profile information.
  </Step>

  <Step title="Save and enable the connection">
    Select **Create** to save the connection.

    Select the **Applications** tab and enable the connection for the applications that should offer GitHub login.
  </Step>
</Steps>

## Test the connection

Verify that the GitHub connection works before deploying to production.

1. Navigate to [Auth0 Dashboard > Authentication > Social](https://manage.auth0.com/#/social).
2. Select the GitHub connection from the list.
3. Select **Try Connection**.
4. Authenticate with your GitHub account when prompted.
5. Confirm that Auth0 returns user profile data, including the user's GitHub username and email address.

## Keep reading

* [Add Google Login to Your App](/docs/authenticate/identity-providers/social-identity-providers/google)
* [Test Social Connections Using Auth0 Developer Keys](/docs/authenticate/identity-providers/social-identity-providers/devkeys)
* [Create Custom Social Connections](/docs/authenticate/identity-providers/social-identity-providers/oauth2)
