Skip to content

OAuth providers

GitHub

Set up GitHub OAuth for repositories, issues, and code access

Connect your users to GitHub for repository management, issue tracking, pull requests, and code access.

PropertyValue
Provider IDgithub
PKCESupported
Token refreshNot needed (tokens don’t expire)
Access token lifetimeNever expires (revoked after 1 year of inactivity)
Redirect URIShown in Developer Portal

Go to GitHub Developer Settings

Navigate to github.com/settings/developers and click OAuth Apps > New OAuth App.

For organization-owned apps, go to Organization Settings > Developer settings > OAuth Apps.

Fill in app details

  • Application name: The application name (e.g., “My App”)
  • Homepage URL: The application’s URL (e.g., https://myapp.com)
  • Authorization callback URL: Copy the Redirect URI from the Developer Portal
  • Click Register application

Get credentials

After creating the app:

  • Client ID: Displayed on the app page
  • Client Secret: Click Generate a new client secret and copy it immediately

The Client Secret is only shown once. Store it securely.

Open the Developer Portal

Go to portal.alterauth.com and navigate to the application.

Add GitHub provider

Go to OAuth Providers > Add Provider > GitHub.

Enter credentials

  • Client ID: Paste your GitHub Client ID
  • Client Secret: Paste your GitHub Client Secret

Select scopes

Choose the scopes the application needs. See the Available Scopes section below.

Save

Click Save. The provider is now active.

After a user connects via Alter Connect, use the returned grant_id to make API calls:

from alter_sdk import App, HttpMethod
async with App(
api_key="alter_key_...",
caller="my-agent",
) as alter_app:
response = await alter_app.request(
HttpMethod.GET,
"https://api.github.com/user/repos",
grant_id=grant_id,
query_params={"sort": "updated", "per_page": "5"},
)
repos = response.json()
for repo in repos:
print(f"{repo['name']} - {repo.get('description', 'No description')}")
ScopeDescription
repoFull access to public and private repositories
public_repoAccess public repositories only
repo:statusAccess commit statuses
repo_deploymentAccess deployment statuses
repo:inviteAccept/decline repository invitations
delete_repoDelete repositories
ScopeDescription
userFull read/write access to profile (includes user:email and user:follow)
read:userRead-only access to profile data
user:emailRead email addresses
user:followFollow/unfollow users
ScopeDescription
admin:orgFull organization management
write:orgRead/write access to org membership and projects
read:orgRead-only access to org and team membership
ScopeDescription
admin:repo_hookFull access to repository hooks
admin:org_hookFull access to organization hooks
admin:public_keyFully manage public keys
admin:gpg_keyFully manage GPG keys
ScopeDescription
gistWrite access to gists
notificationsAccess notifications
projectRead/write access to user and organization projects
workflowAdd and update GitHub Actions workflows
write:packagesUpload/publish packages
read:packagesDownload packages
codespaceCreate and manage Codespaces
Use CaseMethodURL
List user’s reposGEThttps://api.github.com/user/repos
Get a repositoryGEThttps://api.github.com/repos/{owner}/{repo}
List issuesGEThttps://api.github.com/repos/{owner}/{repo}/issues
Create an issuePOSThttps://api.github.com/repos/{owner}/{repo}/issues
List pull requestsGEThttps://api.github.com/repos/{owner}/{repo}/pulls
Get authenticated userGEThttps://api.github.com/user
  • GitHub OAuth App tokens never expire but are revoked after 1 year of inactivity. There’s no refresh token flow.
  • GitHub requires the Accept: application/json header for JSON responses from the token endpoint. Alter Vault handles this automatically.
  • If the user’s email is not public, Alter Vault automatically fetches it via the /user/emails endpoint (requires user:email scope).
  • GitHub’s API requires the X-GitHub-Api-Version header. When making calls via Alter Vault, you can add it via extra_headers if needed, though most endpoints work without it.