Social Login (OAuth)
Let users sign in with Google, GitHub, or Discord instead of creating a password. Social login reduces friction and increases signups.
Why Use Social Login
- Easier for users - One click to sign in
- Fewer passwords - Less friction, more signups
- Verified emails - Social providers verify emails for you
- More secure - Leverage Google/GitHub security
Accessing OAuth Settings
- Go to Admin > Settings
- Click the Connections tab
- You'll see options for each provider
Google Setup
Step 1: Create Google Cloud Project
- Go to Google Cloud Console
- Click Create Project
- Enter a project name (e.g., "Votlie Login")
- Click Create
Step 2: Enable Google+ API
- Go to APIs & Services > Library
- Search for "Google+ API"
- Click Enable
Step 3: Create OAuth Credentials
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth Client ID
- If asked, configure the consent screen first:
- Choose External
- Fill in app name and email
- Add your domain to authorized domains
- For Application Type, select Web Application
- Add Authorized Redirect URI:
https://yourdomain.com/auth/google/callback
- Click Create
- Copy your Client ID and Client Secret
Step 4: Configure in Votlie
- Go to Admin > Settings > Connections
- Find Google
- Enter your Client ID
- Enter your Client Secret
- Toggle Enable Google Login on
- Click Save
GitHub Setup
Step 1: Create GitHub OAuth App
- Go to GitHub Developer Settings
- Click OAuth Apps > New OAuth App
- Fill in:
- Application name: Your app name
- Homepage URL:
https://yourdomain.com - Authorization callback URL:
https://yourdomain.com/auth/github/callback
- Click Register Application
- Copy your Client ID
- Click Generate a new client secret
- Copy your Client Secret
Step 2: Configure in Votlie
- Go to Admin > Settings > Connections
- Find GitHub
- Enter your Client ID
- Enter your Client Secret
- Toggle Enable GitHub Login on
- Click Save
Discord Setup
Step 1: Create Discord Application
- Go to Discord Developer Portal
- Click New Application
- Enter a name and click Create
- Go to OAuth2 in the sidebar
- Add Redirect URL:
https://yourdomain.com/auth/discord/callback
- Copy your Client ID (from General Information)
- Go to OAuth2 and copy your Client Secret
Step 2: Configure in Votlie
- Go to Admin > Settings > Connections
- Find Discord
- Enter your Client ID
- Enter your Client Secret
- Toggle Enable Discord Login on
- Click Save
Slack Setup
Step 1: Create Slack App
- Go to Slack API
- Click Create New App
- Choose From scratch
- Enter an app name and select your workspace
- Click Create App
Step 2: Configure OAuth
- Go to OAuth & Permissions in the sidebar
- Add a Redirect URL:
https://yourdomain.com/auth/slack/callback
- Under Scopes, add the
identity.basic,identity.email, andidentity.avataruser scopes - Go to Basic Information
- Copy your Client ID and Client Secret
Step 3: Configure in Votlie
- Go to Admin > Settings > Connections
- Find Slack
- Enter your Client ID
- Enter your Client Secret
- Toggle Enable Slack Login on
- Click Save
Testing OAuth
After setting up:
- Open your site in a new browser (or incognito)
- Click Login
- You should see the social login buttons
- Click one to test
- Complete the login with the provider
- You should be redirected back and logged in
Callback URL
The callback URL must match exactly what you enter in the provider's settings.
Format:
https://yourdomain.com/auth/{provider}/callback
Examples:
- Google:
https://yourdomain.com/auth/google/callback - GitHub:
https://yourdomain.com/auth/github/callback - Discord:
https://yourdomain.com/auth/discord/callback - Slack:
https://yourdomain.com/auth/slack/callback
Common mistakes: Using http instead of https, missing the /callback at the end, having a trailing slash when the provider doesn't expect one, wrong domain (www vs non-www).
How Social Login Works
Understanding how social login interacts with user accounts:
- New users: When a user signs in with a social provider for the first time and no account exists, a new account is automatically created using the email address from the social provider. The email is marked as verified since the provider has already confirmed it.
- Existing users: If the email returned by the social provider matches an existing account, the social login is automatically linked to that account. The user can then sign in using either method.
- Multiple providers: Users can connect multiple social accounts (e.g., both Google and GitHub) to a single Votlie account. Any connected provider can be used to sign in.
Rate Limiting
OAuth login attempts are rate-limited to 10 per minute per IP address to prevent abuse.
Troubleshooting
| Problem | Solution |
|---|---|
| "Redirect URI mismatch" | Callback URL doesn't match exactly - check for typos |
| "Invalid client" | Client ID is wrong - copy it again |
| Button not showing | Make sure the provider is enabled in settings |
| "Access denied" | User cancelled, or app not approved by Google |
| Error after clicking button | Check Client Secret is correct |
Google-Specific Issues
- App not verified: For testing, add your email as a test user in Google Console
- Consent screen: Make sure you've configured the OAuth consent screen
GitHub-Specific Issues
- Callback URL mismatch: GitHub is strict - ensure exact match
User Experience
When social login is enabled:
- Users see "Continue with Google/GitHub/Discord" buttons on login page
- Clicking redirects them to the provider
- After approval, they're logged in automatically
- If their email matches an existing account, accounts are linked
Connecting Accounts
Users with existing accounts can connect social logins:
- User goes to Settings > Connections
- Clicks Connect next to a provider
- Completes the OAuth flow
- Account is now linked
They can use either password or social login afterwards.
Disconnecting Accounts
Users can remove a social connection:
- Go to Settings > Connections
- Click Disconnect next to the provider
- Confirm
Users must have at least one login method (password or social).
Tips
| Tip | Why |
|---|---|
| Enable Google first | Most users have Google accounts |
| Test in incognito | Avoids cached login issues |
| Use HTTPS | OAuth requires secure connections |
| Check both flows | Test new signup AND existing user login |
Next Steps
- Email Setup - Configure email notifications
- User Management - Manage users who sign up