Skip to main content
Connect your AI Agents to GitHub for repository access, issue management, and developer workflows.

Connect GitHub to Auth0

GitHub apps use fine grained permissions and hence requesting permissions when configuring Token Vault is not supported. Instead, you should set the required permissions when creating the GitHub app in the GitHub developer settings.
1

GitHub Setup

  1. Sign up for a GitHub Developer account
  2. Set up a new GitHub app via GitHub Developer Settings > GitHub Apps
  3. Use the following settings when configuring your GitHub app:
    • Homepage URL: https://YOUR_AUTH0_DOMAIN
    • Callback URL: https://YOUR_AUTH0_DOMAIN/login/callback
    • Webhook Active: Disabled
    • Permissions: Select the appropriate permissions for your app
    You can find the Auth0 domain in the Auth0 Dashboard.You can find this under Applications > [Your Application] > Settings > Basic Information > Domain.If you are using the custom domains feature, your Auth0 domain is the custom domain. You can find this under Branding > Custom Domains.
  4. Create the app and generate a new client secret in the app settings page that appears.
  5. Note your Client ID and Client Secret
2

Configure the GitHub Social Connection in Auth0

  1. In the Auth0 Dashboard, navigate to Authentication > Social. Select Create Connection and then GitHub. Click Continue.
  2. In General, enter the Client ID and Client Secret from the GitHub OAuth app you created.
  3. In Purpose, toggle on Use for Connected Accounts for Token Vault. This allows the connection to retrieve and securely store access tokens for external APIs. To learn more, read Connected Accounts for Token Vault.
  4. Click Create.
  5. After saving, go the Applications tab and select the applications that should use this connection.
This guide walks you through setting up the GitHub connection in Auth0. For an end-to-end example that shows how to set up your app to call third-party APIs on the user's behalf using a connection like this, read the Call Other's APIs on User's Behalf Quickstart.

Token Vault configuration Example

To configure the Token Vault for your GitHub connection, you can use the following code snippet in your application:
  • JavaScript
  • Python
const auth0AI = new Auth0AI();

export const withGitHubConnection = auth0AI.withTokenVault({
  connection: "github",
  // scopes are not supported for GitHub yet. Set required scopes when creating the accompanying GitHub app
  scopes: [],
  refreshToken: getAuth0RefreshToken(),
});

Next steps