How to set up social login with GitHub
Adding social login with GitHub to your app with Clerk is simple - you only need to set the Client ID, Client Secret and Authorized redirect URI in your instance settings.
To make the development flow as smooth as possible, Clerk uses preconfigured shared OAuth credentials and redirect URIs for development instances - no other configuration is needed.
For production instances, you will need to generate your own Client ID and Client secret using your GitHub account.
The purpose of this guide is to help you create a GitHub account and a GitHub OAuth app - if you're looking for step-by-step instructions using Clerk to add social login (OAuth) to your application, follow the Social login (OAuth) guide.
Before you start
- You need to create a Clerk Application in your Clerk Dashboard. For more information, check out our Set up your application guide.
- You need to have a GitHub account. To create one, click here.
Configuring GitHub social login
First, you need to register a new OAuth GitHub app. Follow the official GitHub instructions on how to create an OAuth app.
Go to the Social Login page and enable GitHub. In the modal that opened, ensure Use custom credentials is enabled and copy Authorized redirect URI. Go back to the GitHub panel, paste the value into the Authorization callback URL field and complete the registration.
Once registration is complete, you'll get redirected to project's admin panel. Click the Generate a new client secret button to get your new client secret. Then, copy the Client ID and Client secret. Go back to the Clerk Dashboard and paste them into the respective fields.
Don't forget to click Apply in the Clerk dashboard. Social login with GitHub is now configured.