Configure Google
Enable users to sign in with their Google accounts.
Authority instance running
Admin access to Authority dashboard
Google Cloud Console account
Step 1: Create Google OAuth App
Create a new project or select existing one
Navigate to APIs & Services > Credentials
Click Create Credentials > OAuth client ID
If prompted, configure the OAuth consent screen:
Choose External for public apps or Internal for organization-only
Fill in app name, user support email, and developer contact
Add scopes: email, profile, openid
Add test users if in testing mode
For OAuth client ID:
Application type: Web application
Authorized redirect URIs: https://your-authority-domain/auth/google/callback
Save your Client ID and Client Secret
Using Admin Dashboard
Log in to Authority admin dashboard
Navigate to Settings > Social Login
Enter your credentials:
Client ID: your-google-client-id.apps.googleusercontent.com
Client Secret: your-google-client-secret
Using Environment Variables
Add a Google sign-in button to your application:
With forward URL (redirect after login):
Step 4: Test the Integration
Click your Google sign-in button
You should be redirected to Google's consent page
After approving, you'll be redirected back to Authority
A new user account is created (or existing account linked)
You're redirected to your application
User Data Retrieved
Authority fetches the following from Google:
Whether email is verified
Troubleshooting
"redirect_uri_mismatch" Error
The callback URL doesn't match what's configured in Google Console.
Solution: Ensure the redirect URI in Google Console exactly matches:
"Access blocked: App not verified"
Your app is in testing mode and the user isn't a test user.
Solution: Either:
Add the user as a test user in Google Console
Submit your app for verification (production)
"Invalid client" Error
The client ID or secret is incorrect.
Solution:
Verify credentials in Authority settings
Check for extra spaces or characters
Regenerate secret if needed
User Not Created
Check Authority logs for errors. Common issues:
Email already exists with different provider
Database connection issues
Security Best Practices
Verify emails - Google provides email_verified claim
Use HTTPS - Required for OAuth callbacks
Restrict domains - In Google Console, you can restrict to your domain
Review permissions - Only request scopes you need
Monitor usage - Check Google Console for suspicious activity