Social Authentication Setup
Configure OAuth 2.0 social authentication providers for your Flowless instance to enable login with Google, Facebook, GitHub, and more.
Overview
Flowless supports social authentication (OAuth 2.0) with popular providers:
- ✅ GitHub
- ✅ Custom OAuth 2.0 providers
Benefits of Social Auth
- Faster Registration: Users can sign up in one click
- Better Security: No password to remember or manage
- Higher Conversion: Reduces friction in signup process
- Verified Emails: Social providers verify email addresses
- Profile Data: Get user's name, picture, and email automatically
General Setup Process
For each provider, you'll need to:
- Create an app in the provider's developer console
- Get Client ID and Client Secret
- Configure redirect URI
- Add credentials to Flowless
- Enable the provider
Google OAuth Setup
Step 1: Create Google OAuth App
- Go to Google Cloud Console
- Create a new project or select existing
- Navigate to APIs & Services → Credentials
- Click Create Credentials → OAuth 2.0 Client ID
- Select Web application
Step 2: Configure OAuth Consent Screen
- Go to OAuth consent screen
- Select External user type
- Fill in app information:
- App name: Your app name
- User support email: Your email
- Developer contact: Your email
- Add scopes:
userinfo.emailuserinfo.profile
- Save and continue
Step 3: Get Credentials
- Go back to Credentials
- Create OAuth 2.0 Client ID
- Add authorized redirect URIs:
https://your-instance.pubflow.com/auth/social/google/callback - Copy Client ID and Client Secret
Step 4: Add to Flowless
- Go to Pubflow Dashboard → Your Instance → Settings → Social Auth
- Enable Google
- Enter:
- Client ID: Your Google Client ID
- Client Secret: Your Google Client Secret
- Save
Facebook OAuth Setup
Step 1: Create Facebook App
- Go to Facebook Developers
- Click My Apps → Create App
- Select Consumer app type
- Fill in app details
Step 2: Configure Facebook Login
- Add Facebook Login product
- Go to Settings → Basic
- Add App Domains:
your-instance.pubflow.com - Copy App ID and App Secret
Step 3: Configure OAuth Redirect
- Go to Facebook Login → Settings
- Add Valid OAuth Redirect URIs:
https://your-instance.pubflow.com/auth/social/facebook/callback - Save changes
Step 4: Add to Flowless
- Go to Pubflow Dashboard → Social Auth
- Enable Facebook
- Enter:
- App ID: Your Facebook App ID
- App Secret: Your Facebook App Secret
- Save
GitHub OAuth Setup
Step 1: Create GitHub OAuth App
- Go to GitHub Settings
- Click OAuth Apps → New OAuth App
- Fill in:
- Application name: Your app name
- Homepage URL:
https://yourdomain.com - Authorization callback URL:
https://your-instance.pubflow.com/auth/social/github/callback
- Click Register application
Step 2: Get Credentials
- Copy Client ID
- Generate Client Secret
- Copy Client Secret
Step 3: Add to Flowless
- Go to Pubflow Dashboard → Social Auth
- Enable GitHub
- Enter:
- Client ID: Your GitHub Client ID
- Client Secret: Your GitHub Client Secret
- Save
Twitter OAuth Setup
Step 1: Create Twitter App
- Go to Twitter Developer Portal
- Create a new project and app
- Go to App Settings → User authentication settings
- Enable OAuth 2.0
Step 2: Configure OAuth
- Set Type of App: Web App
- Add Callback URI:
https://your-instance.pubflow.com/auth/social/twitter/callback - Add Website URL:
https://yourdomain.com - Copy Client ID and Client Secret
Step 3: Add to Flowless
- Go to Pubflow Dashboard → Social Auth
- Enable Twitter
- Enter:
- Client ID: Your Twitter Client ID
- Client Secret: Your Twitter Client Secret
- Save
LinkedIn OAuth Setup
Step 1: Create LinkedIn App
- Go to LinkedIn Developers
- Click Create app
- Fill in app details
- Verify your app
Step 2: Configure OAuth
- Go to Auth tab
- Add Redirect URLs:
https://your-instance.pubflow.com/auth/social/linkedin/callback - Request Sign In with LinkedIn product
- Copy Client ID and Client Secret
Step 3: Add to Flowless
- Go to Pubflow Dashboard → Social Auth
- Enable LinkedIn
- Enter:
- Client ID: Your LinkedIn Client ID
- Client Secret: Your LinkedIn Client Secret
- Save
Custom OAuth Provider
Step 1: Configure Custom Provider
- Go to Pubflow Dashboard → Social Auth → Custom Provider
- Click Add Custom Provider
- Fill in:
- Provider Name: e.g., "MyProvider"
- Authorization URL:
https://provider.com/oauth/authorize - Token URL:
https://provider.com/oauth/token - User Info URL:
https://provider.com/oauth/userinfo - Client ID: Your client ID
- Client Secret: Your client secret
- Scopes:
email profile
Step 2: Configure Redirect URI
Add this redirect URI to your OAuth provider:
https://your-instance.pubflow.com/auth/social/custom/callbackTesting Social Auth
Test Login Flow
- Go to your app's login page
- Click "Login with Google" (or other provider)
- Authorize the app
- Verify you're logged in
- Check user data is correct
Test via API
bash
# Initiate OAuth flow
curl https://your-instance.pubflow.com/auth/social/google
# This will redirect to Google's OAuth page
# After authorization, user is redirected back with session_idFrontend Implementation
React Example
typescript
function SocialLogin() {
const handleGoogleLogin = () => {
window.location.href = `${FLOWLESS_URL}/auth/social/google`;
};
const handleFacebookLogin = () => {
window.location.href = `${FLOWLESS_URL}/auth/social/facebook`;
};
const handleGitHubLogin = () => {
window.location.href = `${FLOWLESS_URL}/auth/social/github`;
};
return (
<div>
<button onClick={handleGoogleLogin}>
Login with Google
</button>
<button onClick={handleFacebookLogin}>
Login with Facebook
</button>
<button onClick={handleGitHubLogin}>
Login with GitHub
</button>
</div>
);
}Handling Callback
After successful OAuth, Flowless redirects to your app with session_id:
https://yourdomain.com/auth/callback?session_id=ses_xyz123&user_id=usr_abc456typescript
// In your callback page
useEffect(() => {
const params = new URLSearchParams(window.location.search);
const sessionId = params.get('session_id');
const userId = params.get('user_id');
if (sessionId) {
localStorage.setItem('session_id', sessionId);
window.location.href = '/dashboard';
}
}, []);Account Linking
Link Social Account
Users can link multiple social accounts to one Flowless account:
bash
POST /auth/social/link
Headers: X-Session-ID: ses_xyz123
Body: {
"provider": "google",
"access_token": "google_access_token"
}Unlink Social Account
bash
DELETE /auth/social/unlink/google
Headers: X-Session-ID: ses_xyz123Security Considerations
State Parameter
Flowless automatically includes a state parameter to prevent CSRF attacks.
Scope Limitations
Only request necessary scopes:
- ✅
email,profile- Essential - ❌
contacts,calendar- Unnecessary
Token Storage
- Social access tokens are stored securely
- Refresh tokens are encrypted
- Tokens are never exposed to frontend
Troubleshooting
"Redirect URI mismatch"
- Verify redirect URI in provider console matches exactly:
https://your-instance.pubflow.com/auth/social/{provider}/callback
"Invalid client ID"
- Double-check Client ID and Client Secret
- Ensure no extra spaces
- Regenerate credentials if needed
"App not verified"
- Some providers require app verification for production
- Submit app for review in provider console
Next Steps
- Social Login Guide - Implement social login
- User Registration - User registration flow
- API Reference - Social auth API endpoints