🔐 Google Social Login Setup
Configure Google OAuth for seamless social login with Web3Auth in your XRP Genie project.
🎯 Overview
Google OAuth allows users to login with their Google accounts through Web3Auth. This provides:
- Familiar login experience - Users trust Google authentication
- No password management - Secure OAuth flow
- Instant onboarding - One-click wallet creation
🚀 Step 1: Create Google Cloud Project
- Go to Google Cloud Console
- Click “Create Project” or select existing project
- Enter project name:
My XRP Genie App - Click “Create”
⚙️ Step 2: Enable Google+ API
- In Google Cloud Console, go to “APIs & Services” → “Library”
- Search for “Google+ API”
- Click on it and press “Enable”
🔑 Step 3: Create OAuth Credentials
- Go to “APIs & Services” → “Credentials”
- Click ”+ Create Credentials” → “OAuth client ID”
- If prompted, configure OAuth consent screen:
- Application type: External
- App name: Your app name
- User support email: Your email
- Developer contact: Your email
- For OAuth client ID:
- Application type: Web application
- Name:
XRP Genie Web Client - Authorized origins:
http://localhost:3000 https://yourdomain.com - Authorized redirect URIs:
http://localhost:3000/auth/callback https://yourdomain.com/auth/callback
📋 Step 4: Copy Client Information
After creation, you’ll get:
- Client ID:
xxxxxxxxx-xxxxxxxxxxxxxxxx.apps.googleusercontent.com - Client Secret:
xxxxxxxxxxxxxxxxxxxxxxxx
Important: You’ll use the Client ID with Web3Auth (not XRP Genie directly).
🔧 Step 5: Configure Web3Auth
- Go to Web3Auth Dashboard
- Select your project
- Go to “Social Login” → “Google”
- Enter your Google Client ID
- Save configuration
✅ Step 6: Test Integration
- Run your XRP Genie Web3Auth project:
npm run dev - Open
http://localhost:3000 - Click “Login”
- You should see Google as a login option
- Click Google and test the OAuth flow
🛠️ Configuration Options
OAuth Consent Screen
- App Logo: Upload your app logo for branding
- Privacy Policy: Add your privacy policy URL
- Terms of Service: Add your terms URL
Scopes
Default scopes for Web3Auth:
openid- OpenID Connectprofile- Basic profile infoemail- Email address
⚠️ Common Issues
“OAuth Error: redirect_uri_mismatch”
Cause: Redirect URI doesn’t match Google Console settings
Solution:
- Check authorized redirect URIs in Google Console
- Ensure exact match with your domain
- Include both
http://localhost:3000and production domain
“This app isn’t verified”
Cause: App is in testing mode
Solution:
- For development: Click “Advanced” → “Go to [App Name] (unsafe)”
- For production: Submit app for verification in Google Console
Google Login Not Appearing
Cause: Web3Auth configuration issue
Solution:
- Verify Google Client ID in Web3Auth dashboard
- Check Web3Auth project is using correct environment
- Ensure Google+ API is enabled
🌐 Production Deployment
1. Update Authorized Origins
https://yourapp.com
https://www.yourapp.com
2. Update Redirect URIs
https://yourapp.com/auth/callback
https://www.yourapp.com/auth/callback
3. Publish OAuth Consent Screen
- Submit for Google verification if needed
- Add privacy policy and terms
- Upload verified domain
🔒 Security Best Practices
✅ Do:
- Use HTTPS in production
- Keep Client Secret secure (not used in Web3Auth flow)
- Regularly review authorized domains
- Monitor OAuth usage in Google Console
❌ Don’t:
- Add unnecessary redirect URIs
- Use HTTP in production
- Share Client Secret publicly
💡 Pro Tips
- Branding: Upload app logo for professional appearance
- Domains: Add all environments (dev, staging, prod)
- Testing: Use different Google accounts to test flow
- Analytics: Monitor login success rates in Google Console