docs/main/administration-guide/onboard/sso-gitlab.mdx
Follow these steps to configure Mattermost to use GitLab as a Single Sign-on (SSO) service for team creation, account creation, and user login.
- Only the default GitLab SSO is officially supported. - "Double SSO", where GitLab SSO is chained to other SSO solutions, is not supported. It may be possible to connect GitLab SSO with AD, LDAP, SAML, or MFA add-ons in some cases, but because of the special logic required, they're not officially supported, and they're known not to work in some cases. - Mattermost Free (self-hosted only) supports the OAuth 2.0 standard. - Mattermost Professional and Mattermost Enterprise support the OpenID Connect standard.
https://{gitlab-site-name}/profile/applications. For {gitlab-site-name} use the name of your GitLab instance. If you're using GitLab itself as your service provider, use gitlab.com.
In the Name field, enter
Mattermost.In the Redirect URI field, add the following two lines using your own value for {mattermost-site-name}.
texthttps://{mattermost-site-name}/login/gitlab/complete https://{mattermost-site-name}/signup/gitlab/completeIf your GitLab instance is not set up to use SSL, your URIs must begin with
http://instead ofhttps://.
- Select scopes.
- For Mattermost Team Edition, select
read_user.- For Mattermost Enterprise, select
read_user,openid,profile, and
http:// instead of https://. If you are using GitLab itself as your provider, use gitlab.com.https://gitlab.com/.well-known/openid-configuration.config.json file and specify the scopes you selected in GitLab under the GitLabSettings property. At a minimum, openid is a required scope for Mattermost Enterprise and Professional, and read_user is a required scope for Mattermost Team Edition. Mattermost Team Edition does not work with scopes other than read_user. Changes to this setting require a server restart before taking effect.To force all users to sign-up with SSO only, set System Console > Authentication > Email > Enable sign-in with email to false Users must change their login method before they can log in to Mattermost with GitLab.
At this time, LDAP data isn't compatible with OpenID. If you currently rely on LDAP to manage your users' teams, channels, groups, or attributes, you won't be able to do this automatically with users who have logged in with OpenID. If you need LDAP synced to each user, we suggest using SAML or LDAP as the login provider. Some OpenID providers can use SAML instead, like Keycloak.