Auth Providers
Configure OAuth providers for Supabase authentication.
Enable social login by configuring OAuth providers for your Supabase projects.
Supported Providers
Supascale supports all Supabase Auth providers:
| Provider | Documentation |
|---|---|
| Google OAuth Setup | |
| GitHub | GitHub OAuth Apps |
| GitLab | GitLab Applications |
| Discord | Discord Developer Portal |
| Twitter Developer Portal | |
| Facebook Developers | |
| Apple | Apple Developer |
| Azure | Azure Portal |
| Bitbucket | Bitbucket Settings |
| Slack | Slack API |
| Spotify | Spotify Developer |
| Twitch | Twitch Developer |
| LinkedIn Developer | |
| Notion | Notion Developers |
| Zoom | Zoom App Marketplace |
Viewing Configured Providers
Via Web UI
- Click on a project
- Go to Auth Providers tab
- See configured and available providers
Via API
curl https://supascale.example.com/api/v1/projects/my-project/auth-providers \ -H "X-API-Key: your-api-key"
Response:
{
"configured": [
{
"provider": "google",
"enabled": true,
"clientId": "xxx...xxx",
"clientSecret": "****"
}
],
"available": [
{
"provider": "github",
"displayName": "GitHub",
"configFields": ["clientId", "clientSecret"]
}
]
}
Configuring a Provider
General Setup Steps
- Create OAuth application with the provider
- Set the callback URL:
https://your-project-api/auth/v1/callback - Copy Client ID and Client Secret
- Configure in Supascale
Via Web UI
- Click on a project
- Go to Auth Providers tab
- Click Add Provider
- Select the provider
- Enter Client ID and Secret
- Click Save
- Restart the project
Via API
curl -X PUT https://supascale.example.com/api/v1/projects/my-project/auth-providers \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"providers": [
{
"provider": "google",
"enabled": true,
"clientId": "your-google-client-id",
"clientSecret": "your-google-client-secret"
}
]
}'
Provider-Specific Setup
- Go to Google Cloud Console
- Create a new project or select existing
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth 2.0 Client ID
- Select Web application
- Add authorized redirect URI:
https://your-api-url/auth/v1/callback - Copy Client ID and Secret
{
"provider": "google",
"enabled": true,
"clientId": "xxxxx.apps.googleusercontent.com",
"clientSecret": "GOCSPX-xxxxx"
}
GitHub
- Go to GitHub Developer Settings
- Click New OAuth App
- Set Homepage URL to your app
- Set Authorization callback URL:
https://your-api-url/auth/v1/callback - Copy Client ID and generate Client Secret
{
"provider": "github",
"enabled": true,
"clientId": "your-github-client-id",
"clientSecret": "your-github-client-secret"
}
Discord
- Go to Discord Developer Portal
- Click New Application
- Go to OAuth2 section
- Add redirect:
https://your-api-url/auth/v1/callback - Copy Client ID and Secret
{
"provider": "discord",
"enabled": true,
"clientId": "your-discord-client-id",
"clientSecret": "your-discord-client-secret"
}
Apple
- Go to Apple Developer
- Create an App ID with Sign In with Apple enabled
- Create a Services ID
- Configure domains and return URLs
- Create and download a key
{
"provider": "apple",
"enabled": true,
"clientId": "your-services-id",
"clientSecret": "your-secret-key",
"additionalConfig": {
"teamId": "your-team-id",
"keyId": "your-key-id"
}
}
Enabling/Disabling Providers
Toggle provider without removing configuration:
curl -X PUT https://supascale.example.com/api/v1/projects/my-project/auth-providers \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"providers": [
{
"provider": "google",
"enabled": false,
"clientId": "existing-client-id",
"clientSecret": "existing-client-secret"
}
]
}'
Callback URL
All providers use the same callback URL format:
https://[YOUR-PROJECT-API-URL]/auth/v1/callback
Example: https://api.myapp.com/auth/v1/callback
Client Usage
After configuring providers, use them in your application:
import { createClient } from '@supabase/supabase-js'
const supabase = createClient(apiUrl, anonKey)
// Sign in with Google
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'google',
options: {
redirectTo: 'https://myapp.com/auth/callback'
}
})
// Sign in with GitHub
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'github'
})
Troubleshooting
"Invalid redirect URI"
- Verify callback URL matches exactly
- Check for trailing slashes
- Ensure HTTPS is used in production
"Client ID not found"
- Verify Client ID is correct
- Check the OAuth app is published/active
- Restart the project after changes
User Can't Sign In
- Verify provider is enabled
- Check provider app permissions/scopes
- Review auth service logs
Best Practices
- Use HTTPS for production callback URLs
- Secure credentials - never expose client secrets
- Test thoroughly before enabling in production
- Document which providers are enabled for your team