Skip to main content

Usage

Prerequisites

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
  2. Go to your Magic Dashboard
  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
    await magic.oauth2.loginWithRedirect({
      provider: 'github',
      redirectURI: 'https://your-app.com/your/oauth/callback', // whitelist this with GitHub
    });
    
GitHub OAuth application settings with Authorization callback URL input field
  1. Click Register App to complete your GitHub OAuth app setup
  2. On the next page, obtain the Client ID and Client Secret
GitHub application showing Client ID and Client Secret credentials
  1. Return to your Magic Dashboard and input the Client ID and Client Secret for your GitHub OAuth app
  2. In Magic Dashboard, click Save

Resources