Configuring GitLab Single-Sign-On
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 go to the Applications section either in Profile Settings or Admin Area.
- 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, use http://).
-
Submit the application and copy the given Id and Secret into the appropriate SSOSettings fields in config/config.json
-
Also in config/config.json, set Enable to
true
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
or HTTP
prefix for endpoint URLs matches your server configuration.
-
(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 to
true
. -
Restart your Mattermost server to see the changes take effect.