Documentation Index
Fetch the complete documentation index at: https://docs.steward.fi/llms.txt
Use this file to discover all available pages before exploring further.
OAuth Providers
Steward supports OAuth sign-in with Google, Discord, and Twitter/X. All flows use the PKCE (Proof Key for Code Exchange) extension for security, with no client secret exposed to the browser.Supported Providers
| Provider | SDK Name | Status |
|---|---|---|
"google" | ✅ Supported | |
| Discord | "discord" | ✅ Supported |
| Twitter/X | "twitter" | ✅ Supported |
How It Works (PKCE Flow)
SDK Usage
Configuration Options
Redirect Flow (Non-Popup)
For environments where popups are blocked, use the redirect flow:React Usage
The<StewardLogin> component renders OAuth buttons based on which providers are enabled on the server:
GET /auth/providers to discover which OAuth providers are available. Buttons are only shown for providers that are both enabled on the server and not disabled via props.
Setting Up OAuth Apps
- Go to Google Cloud Console
- Create a new OAuth 2.0 Client ID (Web application)
- Add authorized redirect URI:
- Copy the Client ID and Client Secret
Discord
- Go to Discord Developer Portal
- Create a new application
- Go to OAuth2 settings
- Add redirect URI:
- Copy the Client ID and Client Secret
Twitter/X
- Go to Twitter Developer Portal
- Create a project and app
- Enable OAuth 2.0 with PKCE
- Add callback URL:
- Copy the Client ID
Redirect URIs
All OAuth providers require a registered redirect URI. The pattern is:API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/auth/providers | GET | Discover enabled auth methods |
/auth/oauth/{provider}/authorize | GET | Start OAuth flow (redirect to provider) |
/auth/oauth/{provider}/callback | GET | Provider redirect target |
/auth/oauth/{provider}/token | POST | Exchange code for session (PKCE) |
Security
- All flows use PKCE (S256 challenge method) to prevent authorization code interception
- State parameter prevents CSRF attacks
- Code verifier is stored client-side and never sent to the provider
- Popup polling includes a 5-minute timeout
- Provider tokens are not stored; only the Steward JWT is persisted
Related
- Auth Overview — Session management
- Passkeys — Alternative passwordless method
- Self-Hosting — Environment variable reference