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

Description

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

On mysql.test.mattermost.com, Google SSO fails with `linda@mattermost.com` and succeeds with `lindalu@gmail.com`

  • 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 `linda.mitchell@mattermost.com` to then change it it to Google SSO

  • While switching it made me use `linda@mattermost.com` rather than `linda.mitchell@mattermost.com` 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`

`linda@mattermost.com` 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):

Observed:

  • 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)

Status

Mana

None

Assignee

Eli Yukelzon

Reporter

Linda Mitchell

Epic Link

None

Fix versions

Mattermost Team

Platform

Sprint

None

Labels

GitHub Issue

None

QA Assignee

Linda Mitchell

QA Testing Areas

OAuth