Fix for Microsoft Entra External ID + Google Sign-In — by John Matthew Young
When Google is configured as a federated identity provider in Microsoft Entra External ID, sign-in fails with
Error 400: invalid_request when a user selects a previously signed-in account from the account picker.
The error includes flowName=GeneralOAuthFlow in the request details.
The root cause: Entra automatically appends a username parameter to the OAuth2 authorization
request it sends to Google. Google's OAuth2 implementation rejects this parameter outright.
Direct "Sign in with Google" flows work fine — the issue is specific to Entra-orchestrated flows.
A lightweight proxy sits between Entra and Google. It intercepts the authorization request,
strips the username parameter, and forwards the cleaned request to Google.
The only Entra configuration change is pointing the Well-known endpoint at the proxy
instead of Google directly.
A hosted instance is running at
google-auth-proxy.jmatthewyoung.com.
It does not log, store, or inspect any data — it only strips the username parameter and redirects.
For production, self-hosting (Option 2) is recommended.
Google will label the sign-in button correctly.| Field | Value |
|---|---|
| Display name | Google |
| Well-known endpoint | https://google-auth-proxy.jmatthewyoung.com/api/well-known/openid-configuration |
| Issuer URI | https://accounts.google.com |
| Client ID | Your Client ID from Google Cloud Console |
| Client Authentication Method | Client secret |
| Client Secret | Your Client Secret from Google Cloud Console |
| Scope | openid profile email |
| Response Type | code |
Deploy your own instance for full control over the infrastructure.
git clone https://github.com/jmatthewyoung/google-auth-proxy.git cd google-auth-proxy dotnet run --project GoogleAuthProxy/GoogleAuthProxy.csproj
Verify it's working: http://localhost:7136/api/well-known/openid-configuration
func azure functionapp publish <YOUR_FUNCTION_APP_NAME>Or publish from Visual Studio via Right-click project → Publish.
*.azurewebsites.net URL —
Chrome will show a "Dangerous site" warning for that domain during the OAuth redirect.
Set up a custom domain (e.g. auth-proxy.yourdomain.com) and use that as your proxy URL.
Follow the same steps as Option 1, replacing the well-known endpoint with your custom domain:
| Field | Value |
|---|---|
| Well-known endpoint | https://auth-proxy.yourdomain.com/api/well-known/openid-configuration |
| (all other fields are identical to Option 1) | |
| Endpoint | What it does |
|---|---|
GET /api/well-known/openid-configuration |
Returns Google's OIDC discovery doc with authorization_endpoint rewritten to point to the proxy |
GET /api/auth |
Receives the auth request from Entra, strips the username parameter, and 302-redirects to Google |
Users can select a previously signed-in Google account from the account picker without hitting the error.
username parameter that Google rejects.
Please fix this and make this proxy unnecessary.