Config option "RestrictCreationToDomains" seems incompatible with Gitlab SSO

I’ve set the option “RestrictCreationToDomains” to “inf.ufpr.br”, in the “TeamSettings” sections of the config file. But now when I try to create a new team using “Create new team with Gitlab Account” in the main page I get the following error:

"Email must be from a specific domain (e.g. @example.com). Please ask your systems administrator for details."

On Gitlab my e-mail ends with @inf.ufpr.br, so it should work, but because of how fast Mattermost gives the error message I believe it’s not even checking Gitlab.

Mattermost log file shows this:

[2016/02/19 09:50:52 BRST] [EROR] /api/v1/teams/create_with_sso/gitlab:isTeamCreationAllowed code=500 rid=xxxx uid= ip=xxxx Email must be from a specific domain (e.g. @example.com). Please ask your systems administrator for details. [details: ]

I’m using Mattermost 2.0 (but the problem happens on 1.4 too) and Gitlab 8.4.

Hi @dpasqualin,

Thanks for the report! I confirmed the issue. It seems no emails will work for gitlab SSO if domain restriction is in effect. I have filed a ticket.

Thank you! Could you please provide the link for the ticket? I would like to follow it.

Hi @dpasqualin, the ticket crspeller created is here https://mattermost.atlassian.net/browse/PLT-2069.