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

# GitHub Social Login with Magic

> You can allow your users to sign up & log in to your web app with their GitHub account.

## Usage

### Prerequisites

* You will need a [GitHub](https://github.com/) account
* You will need to have the [Magic SDK installed](/embedded-wallets/sdk/overview) into your web app
* You will need to have the [Magic SDK - OAuth Extension](/embedded-wallets/authentication/login/oauth/oauth-implementation) installed into your web app

### GitHub Setup

After installing the OAuth extension, you can now enable GitHub Login for your Magic app:

1. Follow GitHub's instructions to [create an OAuth app](https://docs.github.com/en/developers/apps/creating-an-oauth-app)
2. Go to your [Magic Dashboard](https://dashboard.magic.link/login)
3. Select the Magic app for which you’d like to enable GitHub Login, or create a new app
4. Navigate to **Social Login** from the sidebar
5. Click the toggle for **GitHub**
6. Return to your GitHub Dashboard and add your **Redirect URI** in the **Authorization callback URL** field:

   Add the **Redirect URI** you are passing as the **redirectURI** argument to the **loginWithRedirect** method:

   ```javascript JavaScript icon="square-js" theme={null}
   await magic.oauth2.loginWithRedirect({
     provider: 'github',
     redirectURI: 'https://your-app.com/your/oauth/callback', // whitelist this with GitHub
   });
   ```

<Frame>
  <img src="https://mintcdn.com/magic-newton/mA7B4icGsHcK07ZQ/images/paste-redirect-uri.webp?fit=max&auto=format&n=mA7B4icGsHcK07ZQ&q=85&s=28f5d850ad5b7deb1c7d63e9827bdbb2" alt="GitHub OAuth application settings with Authorization callback URL input field" width="1200" height="747" data-path="images/paste-redirect-uri.webp" />
</Frame>

7. Click **Register App** to complete your GitHub OAuth app setup
8. On the next page, obtain the **Client ID** and **Client Secret**

<Frame>
  <img src="https://mintcdn.com/magic-newton/mA7B4icGsHcK07ZQ/images/obtain-client-credentials.webp?fit=max&auto=format&n=mA7B4icGsHcK07ZQ&q=85&s=deffc9a03ea1c305cc2952a1a59a3ec9" alt="GitHub application showing Client ID and Client Secret credentials" width="1200" height="654" data-path="images/obtain-client-credentials.webp" />
</Frame>

9. Return to your Magic Dashboard and input the **Client ID** and **Client Secret** for your GitHub OAuth app
10. In Magic Dashboard, click **Save**

## Resources

* [GitHub Social Login Demo](https://magic-oauth-v2-dun.vercel.app)
