GitLab OAuth Setup

Prev Next

Enable GitLab OAuth to allow users to sign in to your Rocket.Chat workspace using their GitLab accounts.

Prerequisites

Before you begin, make sure you have:

  • A GitLab application.

  • Your Application ID and Secret.

    • If you don’t already have a GitLab app, go to GitLab Applications.

    • Fill in the required details, select the scopes, and save your app.

    • Once created, GitLab will display the Application ID and Secret. Copy them, you’ll need them for configuring GitLab settings in your Rocket.Chat workspace..

Configure GitLab OAuth

Once you have your GitLab application credentials, configure GitLab OAuth in Rocket.Chat:

  1. In your Rocket.Chat workspace, go to ManageWorkspace → Settings → OAuth and expand the GitLab section.

  2. Toggle OAuth Enabled to on.

  3. Enter the following values:

    • GitLab URL: The base URL of your GitLab instance. Use https://gitlab.com for GitLab.com, or enter your self-hosted instance URL.

    • GitLab Id: Enter the Application ID from your GitLab OAuth application.

    • Client Secret: Enter the Secret from your GitLab OAuth application.

    • Identity Path: The endpoint used to retrieve user information.Default: /api/v4/user. Only change this if your GitLab instance uses a custom path.

    • (Optional) Merge Users: Enable this option to merge users with the same email address.

  4. Verify that the GitLab Callback URL shown in Rocket.Chat matches the callback URL configured in your GitLab application.

  5. Click Save changes.

After saving the configuration, the Sign in with GitLab option appears on the workspace login page. Users can authenticate using their GitLab credentials.

Important

  • The callback URL must match exactly between Rocket.Chat and GitLab, or authentication will fail.

  • Ensure the selected scopes in your GitLab application allow access to user identity information.