Skip to content

GitHub

  1. Go to GitHub Developer Settings → OAuth Apps → New
  2. Set the Authorization callback URL: https://yourapp.com/auth/oauth/github/callback
  3. Copy the Client ID and Client Secret
from authfort import GitHubProvider

GitHubProvider(
    client_id="your-github-client-id",
    client_secret="your-github-client-secret",
)
from authfort import GitHubProvider

GitHubProvider(
    client_id="your-github-client-id",
    client_secret="your-github-client-secret",
)

Required scopes (read:user, user:email) are always included automatically. Use extra_scopes to request additional GitHub API access:

GitHubProvider(
client_id="...",
client_secret="...",
extra_scopes=("repo",),
)
Required ScopeDescription
read:userAccess the user’s profile (name, avatar)
user:emailAccess the user’s email address
MethodEndpointDescription
GET/auth/oauth/github/authorizeStart GitHub OAuth flow
GET/auth/oauth/github/callbackHandle GitHub callback