Setting Up Social Login
Overview
Sociable provides built-in OAuth authentication for Google, Facebook, and Apple. Users can log in with their social accounts without creating separate passwords.
Supported Providers
| Provider | Status | Notes |
|---|---|---|
| Supported | OAuth 2.0 | |
| Supported | OAuth 2.0 | |
| Apple | Supported | Sign in with Apple |
Authentication Settings
Configure social login in Components → Sociable → Settings → Auth:
| Setting | Description | Default |
|---|---|---|
| Override Joomla Login | Use Sociable login page instead of Joomla | Yes |
| Override Joomla Register | Use Sociable registration instead of Joomla | Yes |
| Login Redirect URL | Where to redirect after login | / |
| Register Redirect URL | Where to redirect new users | /welcome |
Google OAuth Settings
| Setting | Description |
|---|---|
| Enable Google Login | Turn on Google sign-in |
| Google Client ID | OAuth client ID from Google Console |
| Google Client Secret | OAuth client secret from Google Console |
Facebook OAuth Settings
| Setting | Description |
|---|---|
| Enable Facebook Login | Turn on Facebook sign-in |
| Facebook Client ID | App ID from Facebook Developer Console |
| Facebook Client Secret | App secret from Facebook Developer Console |
Apple OAuth Settings
| Setting | Description |
|---|---|
| Enable Apple Login | Turn on Sign in with Apple |
| Apple Client ID | Services ID from Apple Developer |
| Apple Team ID | Your Apple Developer team ID |
| Apple Key ID | Key ID for your private key |
| Apple Client Secret | Generated from your private key |
Setting Up Google Login
Step 1: Create Google OAuth Credentials
- Go to Google Cloud Console
- Create a new project or select existing
- Navigate to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- Select Web application
- Add authorized redirect URI:
https://yourdomain.com/index.php?option=com_sociable&task=auth.oauthCallback&provider=google - Save and note the Client ID and Client Secret
Step 2: Configure OAuth Consent Screen
- Go to APIs & Services → OAuth consent screen
- Select External user type
- Fill in app information:
- App name
- User support email
- Developer contact
- Add scopes:
emailprofileopenid
- Add test users if in development
Step 3: Configure in Sociable
- Go to Components → Sociable → Settings → Auth
- Enable Google Login
- Enter Google Client ID
- Enter Google Client Secret
- Save
Setting Up Facebook Login
Step 1: Create Facebook App
- Go to Facebook Developers
- Click My Apps → Create App
- Select Consumer or Business type
- Enter app name and contact email
- Create the app
Step 2: Configure Facebook Login
- In app dashboard, click Add Product
- Select Facebook Login → Set Up
- Choose Web
- Enter your site URL
- Go to Facebook Login → Settings
- Add Valid OAuth Redirect URIs:
https://yourdomain.com/index.php?option=com_sociable&task=auth.oauthCallback&provider=facebook - Save
Step 3: Get App Credentials
- Go to Settings → Basic
- Note the App ID (Client ID)
- Click Show to reveal App Secret (Client Secret)
Step 4: Configure in Sociable
- Go to Components → Sociable → Settings → Auth
- Enable Facebook Login
- Enter Facebook Client ID (App ID)
- Enter Facebook Client Secret (App Secret)
- Save
Step 5: App Review (Production)
For production use:
- Switch app to Live mode
- Complete App Review if required
- Verify business if needed
Setting Up Apple Login
Step 1: Configure App ID
- Go to Apple Developer Portal
- Navigate to Certificates, Identifiers & Profiles
- Go to Identifiers → App IDs
- Create or edit your app ID
- Enable Sign in with Apple capability
- Configure as primary or grouped
Step 2: Create Services ID
- Go to Identifiers → Services IDs
- Click + to register new
- Enter description and identifier (this is your Client ID)
- Enable Sign in with Apple
- Configure domains and return URLs:
- Domain:
yourdomain.com - Return URL:
https://yourdomain.com/index.php?option=com_sociable&task=auth.oauthCallback&provider=apple
- Domain:
- Save
Step 3: Create Private Key
- Go to Keys
- Click + to create new key
- Enter key name
- Enable Sign in with Apple
- Configure which App ID to associate
- Register and download the key file (.p8)
- Note the Key ID
Step 4: Generate Client Secret
Apple uses JWT for client secret. Generate using a script:
// Generate Apple Client Secret
$teamId = 'YOUR_TEAM_ID';
$clientId = 'YOUR_SERVICES_ID';
$keyId = 'YOUR_KEY_ID';
$privateKey = file_get_contents('path/to/AuthKey_XXXX.p8');
$header = base64_encode(json_encode([
'alg' => 'ES256',
'kid' => $keyId
]));
$claims = base64_encode(json_encode([
'iss' => $teamId,
'iat' => time(),
'exp' => time() + (86400 * 180), // 6 months
'aud' => 'https://appleid.apple.com',
'sub' => $clientId
]));
// Sign with ES256 using your private key
// Use a JWT library for production
Step 5: Configure in Sociable
- Go to Components → Sociable → Settings → Auth
- Enable Apple Login
- Enter Apple Client ID (Services ID)
- Enter Apple Team ID
- Enter Apple Key ID
- Enter Apple Client Secret (generated JWT)
- Save
Enable Authentication Plugin
After configuring providers, enable the authentication plugin:
- Go to System → Manage → Plugins
- Search for "Authentication - Sociable"
- Enable the plugin
How It Works
OAuth Flow
- User clicks social login button
- Redirected to provider authorization page
- User grants permission
- Redirected back to callback URL with auth code
- Server exchanges code for access token
- Server fetches user profile
- User logged in or account created
User Matching
When a user authenticates:
- Email Match: If email exists, link accounts
- New User: If no match, create new Joomla user
- Linked Account: Store OAuth credentials for future logins
Data Retrieved
| Field | Apple | ||
|---|---|---|---|
| ✓ | ✓ | ✓* | |
| Name | ✓ | ✓ | ✓* |
| Avatar | ✓ | ✓ | - |
| Provider ID | ✓ | ✓ | ✓ |
*Apple may hide email on subsequent logins
Managing Linked Accounts
User View
Users can manage linked accounts in their profile:
- Go to Profile → Settings
- View connected social accounts
- Link additional accounts
- Unlink accounts (if password is set)
Admin View
Administrators can view OAuth links:
- Go to Components → Sociable → Users
- Select a user
- View Connected Accounts section
Redirect Configuration
Login Redirect
After successful login:
- Uses
loginRedirectUrlsetting - Or returns to the page user came from
- Default:
/
Registration Redirect
After new user registration via OAuth:
- Uses
registerRedirectUrlsetting - Good for onboarding/welcome pages
- Default:
/welcome
Troubleshooting
"Invalid redirect URI"
- Verify redirect URI matches exactly in provider console
- Check for trailing slashes
- Ensure HTTPS is used in production
"OAuth provider not enabled"
- Check provider is enabled in Sociable settings
- Verify Client ID and Secret are set
- Enable Authentication plugin
Apple Login Issues
- Client secret expires (regenerate every 6 months)
- Ensure Services ID is configured correctly
- Return URL must use HTTPS
User Email Not Received
- Facebook: Request
emailpermission in App Review - Apple: Email may be hidden on subsequent logins
- Google: Ensure email scope is included
Security Considerations
- Always use HTTPS in production
- Keep Client Secrets secure
- Regenerate Apple client secret periodically
- Review app permissions regularly
- Monitor for suspicious OAuth activity
Next Steps
- Modules and Plugins - Enable required plugins
- User Profiles - Configure profile creation
- Getting Started - Complete setup guide