Skip to content

Reference

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
CategoryDeveloper Tools
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

Open GitHub Developer Settings, select OAuth Apps, then choose Register a new OAuth application.

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
repoGrants full access to public and private repositories
public_repoGrants access to public repositories only
repo:statusGrants access to commit statuses without code access
repo_deploymentGrants access to deployment statuses
repo:inviteGrants ability to accept/decline repository invitations
delete_repoGrants access to delete adminable repositories
ScopeDescription
userGrants read/write access to profile info (includes user:email and user:follow)
read:userGrants read-only access to user profile data
user:emailGrants read access to user’s email addresses
user:followGrants access to follow or unfollow other users
ScopeDescription
admin:orgFully manage organization and its teams, projects, and memberships
write:orgRead and write access to organization membership and projects
read:orgRead-only access to organization membership and team membership
ScopeDescription
admin:repo_hookGrants full access to repository hooks
admin:org_hookGrants read, write, ping, and delete access to organization hooks
admin:public_keyFully manage public keys
admin:gpg_keyFully manage GPG keys
ScopeDescription
gistGrants write access to gists
notificationsGrants access to user notifications
projectGrants read/write access to user and organization projects
workflowGrants ability to add and update GitHub Actions workflow files
write:packagesGrants access to upload or publish packages in GitHub Packages
read:packagesGrants access to download packages from GitHub Packages
codespaceGrants ability to create 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.
  • See the GitHub OAuth authorization documentation for more details.
  • See Creating an OAuth app for the provider setup flow.

Alter policy rules can target these attested operations and families for operation-level and parameter-aware controls.

Operation IDFamiliesMethodProvider path
repos/getreadGET/repos/{owner}/{repo}
repos/list-for-authenticated-userreadGET/user/repos
repos/create-for-authenticated-userwritePOST/user/repos
repos/updateadminPATCH/repos/{owner}/{repo}
repos/deletedeleteDELETE/repos/{owner}/{repo}
repos/list-branchesreadGET/repos/{owner}/{repo}/branches
repos/get-branchreadGET/repos/{owner}/{repo}/branches/{branch}
repos/list-commitsreadGET/repos/{owner}/{repo}/commits
repos/get-commitreadGET/repos/{owner}/{repo}/commits/{+ref}
repos/list-releasesreadGET/repos/{owner}/{repo}/releases
repos/create-releasewritePOST/repos/{owner}/{repo}/releases
repos/create-forkwritePOST/repos/{owner}/{repo}/forks
repos/list-collaboratorsreadGET/repos/{owner}/{repo}/collaborators
repos/add-collaboratoradminPUT/repos/{owner}/{repo}/collaborators/{username}
repos/remove-collaboratoradminDELETE/repos/{owner}/{repo}/collaborators/{username}
repos/get-contentreadGET/repos/{owner}/{repo}/contents/{+path}
repos/create-or-update-file-contentswritePUT/repos/{owner}/{repo}/contents/{+path}
repos/delete-filedeleteDELETE/repos/{owner}/{repo}/contents/{+path}
git/delete-refdeleteDELETE/repos/{owner}/{repo}/git/refs/{+ref}
issues/list-for-reporeadGET/repos/{owner}/{repo}/issues
issues/getreadGET/repos/{owner}/{repo}/issues/{issue_number}
issues/createwritePOST/repos/{owner}/{repo}/issues
issues/updatewritePATCH/repos/{owner}/{repo}/issues/{issue_number}
issues/create-commentwritePOST/repos/{owner}/{repo}/issues/{issue_number}/comments
issues/list-commentsreadGET/repos/{owner}/{repo}/issues/{issue_number}/comments
pulls/listreadGET/repos/{owner}/{repo}/pulls
pulls/getreadGET/repos/{owner}/{repo}/pulls/{pull_number}
pulls/createwritePOST/repos/{owner}/{repo}/pulls
pulls/updatewritePATCH/repos/{owner}/{repo}/pulls/{pull_number}
pulls/mergewritePUT/repos/{owner}/{repo}/pulls/{pull_number}/merge
pulls/create-reviewwritePOST/repos/{owner}/{repo}/pulls/{pull_number}/reviews
pulls/list-filesreadGET/repos/{owner}/{repo}/pulls/{pull_number}/files
actions/list-repo-workflowsreadGET/repos/{owner}/{repo}/actions/workflows
actions/create-workflow-dispatchwritePOST/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches
actions/list-workflow-runs-for-reporeadGET/repos/{owner}/{repo}/actions/runs
actions/get-workflow-runreadGET/repos/{owner}/{repo}/actions/runs/{run_id}
actions/cancel-workflow-runwritePOST/repos/{owner}/{repo}/actions/runs/{run_id}/cancel
actions/re-run-workflowwritePOST/repos/{owner}/{repo}/actions/runs/{run_id}/rerun
git/create-refwritePOST/repos/{owner}/{repo}/git/refs
search/reposreadGET/search/repositories
users/get-authenticatedreadGET/user

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.