Supabase Github Auth

Note :

  • The login capabilities using GitHub and Google OAuth providers are activated and fully operational within the web application.

  • For users signing up through the OAuth authorization flow outside of the web context, like Your GPTs, the OTP (One-Time Password) method is utilized for login.

Setting up GitHub authentication for your Supabase project allows users to log in with their GitHub accounts. Here's a structured approach to integrate GitHub OAuth into your Supabase account:

Adding GitHub Login to Your Supabase Template

1. Create a GitHub OAuth App

  • Access GitHub: Go to github.com and sign in to your account.

  • Developer Settings: Navigate to your profile's developer settings.

  • OAuth Apps: Select 'OAuth Apps' from the sidebar and proceed to 'New OAuth App'.

2. Configure the GitHub OAuth App

  • Application Setup: Fill in the application name and homepage URL with details about your app.

  • Authorization Callback URL:

    • You’ll need a callback URL from Supabase which can be found under the Authentication section in your project's dashboard.

    • This URL will be in the format https://<project-ref>.supabase.co/auth/v1/callback.

3. Register and Retrieve Credentials

  • Register App on GitHub: Fill in the required fields, including the callback URL you obtained from Supabase, and register the app.

  • Obtain OAuth Credentials: After registration, note down your client ID and generate a client secret. Keep these credentials secure as you'll need them for Supabase.

4. Update Supabase with GitHub Credentials

  • Enter Credentials in Supabase:

    • Go back to your Supabase project dashboard.

    • Under Authentication > Providers, locate GitHub and enable it.

    • Enter the GitHub Client ID and Client Secret you received from GitHub.

  • Save Changes: Make sure to save your updated settings in Supabase.

6. Testing the Integration

  • Test the Login: Ensure the GitHub login is working by testing it in your application. Look for any prompts or errors and resolve them accordingly.

By following these steps, you've configured GitHub authentication for your app, providing a convenient and secure way for users to sign in using their GitHub accounts. Always test thoroughly to ensure a smooth user experience.

Last updated