⚠️ Important: The screenshots and step-by-step instructions on this page
reflect the interface as of December 2025. Third-party services like Google, Facebook,
and Microsoft frequently update their user interfaces. While the general process remains
similar, the exact screens, button labels, and menu locations may differ from what you see.
If you encounter significant differences, consult the provider's official documentation.
This guide walks you through setting up Google OAuth authentication
for your site.
Quick Setup (Already Have Credentials?)
If you already have a Google OAuth Client ID and Secret, just add them to appsettings.json:
For Development: Use User Secrets instead of appsettings.json:
dotnet user-secrets set "Authentication:Google:ClientId" "your-client-id"
dotnet user-secrets set "Authentication:Google:ClientSecret" "your-client-secret"
Redirect URI Format
Environment
Redirect URI
Development
https://localhost:5001/signin-google
Production
https://yourdomain.com/signin-google
Troubleshooting
Error: redirect_uri_mismatch
The redirect URI in your request doesn't match any authorized URIs.
Check that the URI in Google Cloud Console exactly matches your application's callback URL,
including the port number and protocol (https).
Error: access_denied
The user denied the permission request, or the app is in testing mode
and the user isn't added as a test user.
Error: invalid_client
Check that your Client ID and Client Secret are correct and properly configured.