Connect your AI Agents to GitHub for repository access, issue management, and developer workflows.
The GitHub integration allows your AI Agents to authenticate users with their GitHub accounts and access GitHub repositories and manage issues their behalf.
The GitHub integration is perfect for developer focused AI applications that need to interact with code repositories, manage issues, or automate development workflows. This integration provides access to both public and private repositories based on user permissions.
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.
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.
Create the app and generate a new client secret in the app settings page
that appears.
Note your Client ID and Client Secret
2
Configure the GitHub Social Connection in Auth0
In the Auth0 Dashboard, navigate to
Authentication > Social. Select Create Connection and then
GitHub. Click Continue.
In General, enter the Client ID and Client Secret from the
GitHub OAuth app you created.
In Advanced, toggle Enable Token Vault. This allows the
connection to retrieve and store access tokens for third-party APIs
securely. To learn more, read Configure Token
Vault.
Click Create.
After saving, go the Applications tab and select the applications
that should use this connection.
To configure the Token Vault for your GitHub connection, you can use the following code snippet in your application:
Report incorrect code
Copy
Ask AI
const auth0AI = new Auth0AI();export const withGitHubConnection = auth0AI.withTokenForConnection({ connection: "github", // scopes are not supported for GitHub yet. Set required scopes when creating the accompanying GitHub app scopes: [], refreshToken: getAuth0RefreshToken(),});
If you want to use more than one connection for a user, you can link their accounts. This allows the user to log in with any of their linked accounts and have a single user profile in your application. This allows calling APIs from different providers with a single user profile. Learn more about Client-initiated account linking.
Auth0’s Token Vault organizes the access and refresh tokens of federated connections in secure tokensets. Applications can then access the Token Vault to retrieve access tokens to call third-party APIs. To learn more, read Configure Token Vault.