Supported Providers
Supabase supports these OAuth providers:- GitHub
- GitLab
- Bitbucket
- Azure (Microsoft)
- Apple
- Discord
- Twitch
- Slack
- Spotify
- And many more…
Basic OAuth Sign In
Provider Configuration
Before using OAuth, configure each provider in your Supabase dashboard:1
Open Dashboard
Navigate to Authentication > Providers in your Supabase project
2
Enable Provider
Toggle on the provider you want to use (e.g., Google, GitHub)
3
Add Credentials
Enter your OAuth client ID and secret from the provider’s developer console
4
Configure Redirect URL
Add the callback URL to your provider’s app settings:
Google OAuth
Setup Google OAuth
- Go to Google Cloud Console
- Create a new project or select existing
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URI:
https://<project-ref>.supabase.co/auth/v1/callback - Copy Client ID and Secret to Supabase dashboard
Implementation
GitHub OAuth
Setup GitHub OAuth
- Go to GitHub Developer Settings
- Click “New OAuth App”
- Fill in application details
- Authorization callback URL:
https://<project-ref>.supabase.co/auth/v1/callback - Copy Client ID and Secret to Supabase dashboard
Implementation
Apple OAuth
Setup Apple Sign In
- Go to Apple Developer Portal
- Create a new identifier for Sign in with Apple
- Configure Services ID
- Add return URL:
https://<project-ref>.supabase.co/auth/v1/callback - Copy Service ID and Key to Supabase dashboard
Implementation
Request Additional Scopes
Request extra permissions from OAuth providers:Handle OAuth Callback
Next.js App Router
app/auth/callback/route.ts
SvelteKit
routes/auth/callback/+server.ts
Access Provider Tokens
Access the OAuth provider’s access token to call their APIs:Provider tokens are only available for certain providers and must be requested with the appropriate scopes.
Link OAuth Accounts
Link multiple OAuth providers to the same user:Unlink OAuth Accounts
Server-Side OAuth
For server-side OAuth flows, use PKCE (Proof Key for Code Exchange):Mobile Deep Links
Configure deep links for mobile OAuth:- iOS
- Android
Add to
Info.plist:Error Handling
Common OAuth errors:Security Considerations
Use HTTPS
Always use HTTPS in production for OAuth callbacks
Validate State
Supabase automatically validates PKCE state parameters
Rotate Secrets
Regularly rotate OAuth client secrets
Minimal Scopes
Only request the scopes you actually need
Next Steps
Multi-Factor Auth
Add MFA for enhanced security
Row Level Security
Control data access with RLS
