GitLab Single-Sign-On¶
Single-Sign-On can be configured with the following services.
GitLab¶
Follow these steps to configure Mattermost to use GitLab as a single-sign-on (SSO) service for team creation, account creation and sign-in.
Login to your GitLab account and under Profile Settings go to Applications.
Add a new application called “Mattermost” with the following as Redirect URIs:
<your-mattermost-url>/login/gitlab/complete
(example: http://localhost:8065/login/gitlab/complete)<your-mattermost-url>/signup/gitlab/complete
Note: If your GitLab instance is set up to use SSL, your URIs must begin with
https://
. Otherwise, usehttp://
.Submit the application and copy the given Id and Secret into the appropriate GitLabSettings fields in
config/config.json
Also in
config/config.json
, set Enable totrue
for the gitlab section, leave Scope blank and use the following for the endpoints:- AuthEndpoint:
https://<your-gitlab-url>/oauth/authorize
(example https://example.com/oauth/authorize) - TokenEndpoint:
https://<your-gitlab-url>/oauth/token
- UserApiEndpoint:
https://<your-gitlab-url>/api/v3/user
Note: Make sure your
HTTPS
orHTTP
prefix for endpoint URLs matches your server configuration.- AuthEndpoint:
(Optional) If you would like to force all users to sign-up with GitLab only, in the ServiceSettings section of
config/config.json
set DisableEmailSignUp totrue
.Restart your Mattermost server to see the changes take effect.
Notes:¶
- Only the default GitLab SSO is officially supported. “Double SSO”, chaining GitLab SSO to other SSO solutions, is not supported.
- It may be possible to connect to use GitLab SSO in some cases with AD, LDAP, SAML, or MFA add-ons, but because of the special logic required they’re not officially supported and are known not to work on some experiences.
- If having official AD, LDAP, SAML or MFA support is critical to your enterprise, please consider purchasing Mattermost Enterprise Edition. Given all the features of Mattermost, it’s quite affordable.
- See GitLab section of Mattermost forum for troubleshooting help.
- See GitLab Omnibus documentation for installing GitLab Mattermost.