GitHub is a bundled OAuth2 provider in authsome. The default flow is browser-based PKCE; the device code flow is supported for headless setups. Tokens are stored in the local encrypted vault and refreshed transparently before expiry.Documentation Index
Fetch the complete documentation index at: https://authsome.agentr.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
At a glance
| Provider name | github |
| Display name | GitHub |
| Auth type | OAuth2 |
| Default flow | pkce |
| Device code supported | Yes |
| DCR supported | No |
| Default scopes | repo, read:user |
| Proxy host | api.github.com |
Env var (access_token) | GITHUB_ACCESS_TOKEN |
Env var (refresh_token) | GITHUB_REFRESH_TOKEN |
| Provider docs | docs.github.com/… |
Prerequisites
GitHub does not support Dynamic Client Registration, so you need to register an OAuth app once. This is a one-time setup per app, not per developer.Create a new OAuth app
Visit github.com/settings/developers and click New OAuth App.
Set the callback URL
Set Authorization callback URL to:This is the only callback URL authsome’s PKCE flow listens on.
Log in
Client credential collection (first time only)
Authsome opens a local form at
http://127.0.0.1:7998. Paste the client_id and client_secret. They are encrypted and stored under your profile, then reused on every subsequent login.Authorization redirect
A second browser window opens to
https://github.com/login/oauth/authorize. Approve the requested scopes.Token exchange
GitHub redirects to
http://127.0.0.1:7998/auth/callback/oauth with an authorization code. Authsome exchanges it for an access token and stores the encrypted record.Headless setup (SSH, CI)
For machines without a local browser, use the device code flow:Custom scopes
The bundled definition requestsrepo and read:user. Override at login time:
uvx authsome get github.
For the full list of GitHub OAuth scopes, see GitHub’s scopes documentation.
GitHub Enterprise
For self-hosted GitHub Enterprise, pass the base URL of your instance:{base_url} placeholders for the authorization, token, and device code endpoints, so substitution is automatic.
Multiple accounts
Personal and work GitHub on the same machine:--connection <name> on login and on every read command to keep two or more accounts on the same provider side by side. See Multiple connections per provider for the full pattern.
Use the token
Run the agent under the proxy. The library tab is for embedding authsome inside a larger Python orchestrator.GITHUB_ACCESS_TOKEN=authsome-proxy-managed in the child’s environment and injects the real token into outbound requests to api.github.com. The child process never sees the actual value. Refresh tokens are never exported.
Override the bundled definition
To change scopes or point at GitHub Enterprise by default, drop a custom JSON at~/.authsome/providers/github.json. The user-registered file always wins over the bundled one.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
redirect_uri_mismatch at github.com | OAuth app callback URL is wrong | Set it to http://127.0.0.1:7998/auth/callback/oauth exactly. |
| Browser opens but the form is blank | Daemon not running or port held | uvx authsome doctor and check that port 7998 is free. |
Bad credentials after a successful login | Token revoked at GitHub | uvx authsome login github --force to re-authenticate. |
| Refresh fails after long idle | GitHub access tokens do not expire by default; refresh is rarely needed | If the connection shows expired, run uvx authsome login github --force. |
What’s next
Run agents with the proxy
Inject the access token into outbound requests without exposing it.
Multiple connections per provider
Keep two or more accounts on the same provider side by side.
Provider schema
Every field in a provider definition.
OAuth providers
All bundled OAuth providers.