Skip to main content
Supabase supports over 20 OAuth providers for social authentication. Users can sign in with their existing accounts from popular platforms.

Supported Providers

Supabase supports these OAuth providers:
  • Google
  • GitHub
  • GitLab
  • Bitbucket
  • Azure (Microsoft)
  • Apple
  • Facebook
  • Discord
  • Twitch
  • Twitter
  • Slack
  • Spotify
  • LinkedIn
  • 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

  1. Go to Google Cloud Console
  2. Create a new project or select existing
  3. Enable Google+ API
  4. Create OAuth 2.0 credentials
  5. Add authorized redirect URI: https://<project-ref>.supabase.co/auth/v1/callback
  6. Copy Client ID and Secret to Supabase dashboard

Implementation

GitHub OAuth

Setup GitHub OAuth

  1. Go to GitHub Developer Settings
  2. Click “New OAuth App”
  3. Fill in application details
  4. Authorization callback URL: https://<project-ref>.supabase.co/auth/v1/callback
  5. Copy Client ID and Secret to Supabase dashboard

Implementation

Apple OAuth

Setup Apple Sign In

  1. Go to Apple Developer Portal
  2. Create a new identifier for Sign in with Apple
  3. Configure Services ID
  4. Add return URL: https://<project-ref>.supabase.co/auth/v1/callback
  5. 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 multiple OAuth providers to the same user:

Server-Side OAuth

For server-side OAuth flows, use PKCE (Proof Key for Code Exchange):
Configure deep links for mobile OAuth:
Configure deep linking:
Add to Info.plist:

Error Handling

Common OAuth errors:

Security Considerations

Always validate OAuth tokens on the server side before granting access to sensitive resources.

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