Skip to main content
AuthProvider is the abstract base class for OAuth integrations. Implement it to let users connect their accounts.

Abstract methods

name

Unique identifier for this provider. Used in routes and credential storage.

get_url

Generate the OAuth authorization URL.
str
Callback URL where the provider redirects after authorization. Gumstack’s callback URL is https://api.gumstack.com/auth/callback — use this when registering your OAuth app with the third-party service.
str
Opaque value for CSRF protection. Include in the URL.

exchange

Exchange an authorization code for tokens.
str
Authorization code from the OAuth callback.
str
Same redirect URI used in get_url().
Returns TokenResponse with at least access_token.

refresh

Refresh an expired access token.
str
Refresh token from a previous exchange.
Returns TokenResponse with new access_token.

get_nickname

Return a display name for the connected account (shown in UI).
str
Valid access token.
Return something recognizable: email, username, or organization name.

Optional methods

revoke

Revoke an access token when user disconnects.

TokenResponse

Example: Linear