We're Hiring!

Mattermost, Inc.

[SOLVED] Unable to turn off GitLab SSO

GitLab Omnibus 13.6.1-ee with GitLab Mattermost
Mattermost Version: 5.28.1
Database Schema Version: 5.28.0
Database: postgres

After enabling GitLab Mattermost, SSO was automatically configured and enabled. I’m trying to turn GitLab SSO off.

What I did:

  1. Edited /etc/gitlab/gitlab.rb and uncommented the line mattermost['gitlab_enable'] = false
  2. Ran sudo gitlab-ctl reconfigure
  3. Verified that /var/opt/gitlab/mattermost/config.json had been updated correctly ("Enable": false under GitLabSettings)
  4. Restarted Mattermost with sudo gitlab-ctl restart mattermost

The GitLab sign-in option is still being shown on the login screen. In the System Console, under Authentication > GitLab, “Enable authentication with GitLab” is set to true and greyed out, with the message “This setting has been set through an environment variable. It cannot be changed through the System Console.” underneath (this is expected, but it should not be enabled anymore).

I thought I’d ask here before opening an issue. Any ideas?

OK, figured it out. I had to use mattermost['env'] in gitlab.rb.

See Setting custom environment variables and the Mattermost Configuration Settings (Environment Variables).

For example, in gitlab.rb:

mattermost['env'] = { "MM_GITLABSETTINGS_ENABLE" => false }

So it seems like at least some settings in gitlab.rb don’t have any effect, at least not in my configuration (GitLab Omnibus + GitLab Mattermost).

1 Like