Google SSO failing with error `invalid email` on Mattermost GSuite email addresses


Google SSO is failing with Mattermost email addresses, but succeeding with Gmail email addresses. More details:

On, Google SSO fails with `` and succeeds with ``

  • Error page says `invalid email` (not a common error I've seen)

  • Also repros on `prev.test` on v5.14.2, and on a fresh spinmint on v5.15 release branch

  • Repro'ed by Dylan and also Dean and Martin on their locals

  • Not related to 2fa (also have that on my Gmail)

  • Error in server logs `{"level":"error","ts":1568139849.5773754,"caller":"api4/oauth.go:505","msg":"User.IsValid: Invalid email, user_id=f9doz91yiprhppi6z7r1grdsur"}`

2. Next I tried creating email/password account with `` to then change it it to Google SSO

  • While switching it made me use `` rather than `` credentials to be recognized

  • But then preserved `linda.mitchell@` as the account's email address

  • Then trying to sign back in using Google SSO after that gave an unexpected error page `Username must begin with a letter, and contain between 3 to 22 lowercase characters made up of numbers, letters, and the symbols ".", "-", and "_"`, even though the username is `linda0`

`` is what I use every release to test this, so even though I see this both on v5.15 and v5.14.2, is it possible that something else has changed since last release, possibly with our Google Apps config?

Daniel noted a similar question has been asked recently, but we are awaiting further information from that reporter.

Also, I noticed that MM-16149, fixed in v5.14, mentions both of the unusual error messages I saw (and talks about possibly wide-ranging impact; possibly some unforeseen effects from that?).

QA Test Steps

1. Set up Google SSO on a server, ensuring the following are correct in config.json (not editable in UI):


  • Mattermost email address fails to create account, with error page `Invalid Email`

  • Gmail email address succeeds in creating account

Expected: Our corp GSuite emails should successfully create accounts (that's how we test this every release)





Eli Yukelzon


Linda Mitchell

Epic Link


Fix versions

Mattermost Team





GitHub Issue


QA Assignee

Linda Mitchell

QA Testing Areas