Before you start
Before you configure GitHub as a social connection, you need:
- An Auth0 account. If you do not have one, you can sign up for free.
- A GitHub account.
- An application registered in the Auth0 Dashboard.
Configure GitHub
Create an OAuth application in GitHub to generate the credentials Auth0 needs to establish the connection.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.
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:
Replace
| 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 |
YOUR_AUTH0_DOMAIN with your Auth0 tenant domain. You can find this value in Auth0 Dashboard > Applications > Applications under the Settings tab.You can leave Enable Device Flow unchecked unless your application requires device-based authorization.Select Register application.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.
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.
Configure Auth0
Add the GitHub connection to your Auth0 tenant and enter the credentials from the previous section.Create a GitHub connection
Navigate to Auth0 Dashboard > Authentication > Social and select Create Connection. Select GitHub from the list of providers.
Select the connection purpose
Under Purpose, specify how this connection will be used: for login, connected accounts, or both.
Enter your GitHub credentials
In General, enter the Client ID and Client Secret you copied from GitHub.
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.
Test the connection
Verify that the GitHub connection works before deploying to production.- Navigate to Auth0 Dashboard > Authentication > Social.
- Select the GitHub connection from the list.
- Select Try Connection.
- Authenticate with your GitHub account when prompted.
- Confirm that Auth0 returns user profile data, including the user’s GitHub username and email address.