Overview
Third-party providers (OAuth 2.0 and OpenID Connect providers) are configured at the tenant level in SuperTokens Core. This allows for flexible multi-tenant setups where different tenants can have different social login options.Supported Providers
SuperTokens supports any OAuth 2.0 or OpenID Connect compliant provider, including:- Google - OAuth 2.0
- Facebook - OAuth 2.0
- GitHub - OAuth 2.0
- Apple - OAuth 2.0 with Sign in with Apple
- Microsoft - OAuth 2.0 / OIDC
- LinkedIn - OAuth 2.0
- Twitter - OAuth 2.0
- Custom Providers - Any OAuth 2.0 / OIDC provider
Configuration Structure
Providers are configured through the tenant configuration. Each provider configuration includes:Provider Properties
string
required
Unique identifier for the provider (e.g., “google”, “facebook”, “github”)
array
required
Array of client configurations for the provider
Provider Configuration via Tenant API
Providers are managed through the Multi-tenancy API. You can configure providers when creating or updating a tenant.Example: Configuring Google Provider
Example: Multiple Providers
Provider-Specific Configuration
email, profile, openid
Email Verification: Google emails are typically verified by default
email, public_profile
Email Verification: Facebook emails may not be verified
GitHub
user:email
Email Verification: GitHub emails are verified if the user has verified them on GitHub
Apple
email, name
Special Configuration: Apple requires a private key for client secret generation
Enabling/Disabling Third-Party Login
You can enable or disable third-party login for a specific tenant:Checking Provider Configuration
Retrieve the current tenant configuration to see enabled providers:Multi-Tenant Provider Strategy
Strategy 1: Shared Providers
Use the same OAuth app for all tenants:Strategy 2: Tenant-Specific Providers
Use different OAuth apps per tenant:Security Considerations
Best Practices
- Use HTTPS Only: Always configure OAuth redirect URLs with HTTPS
- Validate Redirect URIs: Restrict OAuth redirect URIs to known domains
- Minimal Scopes: Request only the OAuth scopes you need
- Monitor Usage: Track which providers are being used and by whom
- Regular Audits: Periodically review and update provider configurations
Common Provider Issues
Issue: Provider Not Found
Cause: The provider is not configured for the tenant Solution: Verify the provider is added to the tenant’sthirdPartyProviders array
Issue: Invalid Client Credentials
Cause: IncorrectclientId or clientSecret
Solution: Verify credentials match those in the provider’s developer console
Issue: Scope Errors
Cause: Missing required scopes Solution: Ensure all required scopes for the provider are includedIssue: Permission Denied
Cause:thirdPartyEnabled is set to false for the tenant
Solution: Enable third-party login in the tenant configuration
Related APIs
Sign In/Up
Authenticate users with configured providers
Tenant Management
Manage tenant configurations