After upgrading Grafana 9.x to 10.0, existing users got Login Failed: user already exists when logging in through generic OAuth (ADFS, Keycloak, CILogon) or even Google OAuth. The users were created by OAuth in 9.x, and nothing in the OAuth config had changed. Rolling back to 9.x made it work again.
Grafana 10 upgrade: OAuth login fails with "user already exists"
This is the documented Grafana v10 breaking change: OAuth integrations no longer look users up by email, which is how your 9.x users were matched. Existing accounts cant be found by email anymore, so the signup path fails with "user already exists".
The quick fix (marked insecure in the docs, so use with eyes open) is re-enabling email lookups in grafana.ini:
[auth]
oauth_allow_insecure_email_lookup = trueMultiple reporters confirmed this let their users log in again. The proper fix is making the login deterministic instead: set login_attribute_path (e.g. username for Keycloak) in [auth.generic_oauth] so Grafana matches users by the provider's login field rather than email, then you can leave the insecure lookup off.
Source: https://github.com/grafana/grafana/issues/70203
Source: https://github.com/grafana/grafana/issues/70203