GitLab SSO Login

Last updated on
23 August 2023

This document will assist you to configure GitLab as an OAuth/OpenID provider, making Drupal an OAuth Client. Following these steps will allow you to configure OAuth/OpenID SSO between GitLab and your Drupal site such that your users will be able to log in to your Drupal site using their GitLab credentials.

We provide the Drupal OAuth Login - OAuth OIDC SSO module which is compatible with Drupal 7, Drupal 8, Drupal 9, and Drupal 10.

Download  Know more

You can check our modules feedback and ratings here.

Prerequisite:

Setup Video:

drupal oauth login  - Google sso integration video

Step 1: Setting up GitLab as OAuth Provider in Drupal:

  • Navigate to the Configure Application tab and search for GitLab using the search box.

    Drupal Oauth login select Gitlab

  • Now, click on the Copy button to copy the Callback/Redirect URL and keep it handy. After that, click on the Step 2/3 button.

    Drupal OAuth Login Strava copy callback url

Configure OAuth Single Sign-On Application in GitLab:

  • Go to the GitLab admin dashboard and sign up/log in to your account.
  • From the left side menu, select the Settings tab, then Applications.

    Drupal OAuth Login - select setting then application

  • Enter Name of your application in the name text field.

    Drupal OAuth Login Gitlab - Enter Name of your application

  • Enter the Callback/Redirect URL (which we copied in the first step) in the Rdirect URL text field and select Scopes (make sure that the same scopes are also added in the Drupal OAuth Login's module).
  • Click on Save application button to save your cconfiguration.

    Drupal OAuth Login GitLab - Enter Redirect and Select Scopes

Step 2: Client ID and Client Secret setup in Drupal:

  • Copy the Application ID from the GitLab application and paste it into Drupal OAuth Login's Client ID text field.

    Drupal OAuth Login - Copy Application ID

    Drupal OAuth Login -Paste Application ID in Client ID text field

  • Navigate to the Secret and click the Copy button to copy your secret, then paste it into the Drupal OAuth Login's Client Secret text-field. 

    Drupal OAuth Login - Copy Secret

    Drupal OAuth Login - Paste Client Secret

  • Once done, click on the Step 3/3 button.

Step 3: Scope and Endpoints setup in Drupal:

There are two ways using which you can set up the scope and endpoints:

  • Discovery / Well-Known URL:
  • Manual Configuration: 
    • Check the Endpoints and Scope. Click on the All Done! button.

      Drupal OAuth Login - Check Scope and Endpoint

GitLab Endpoints and scope:

Scope read_user
Authorize Endpoint https://gitlab.com/oauth/authorize
Access Token Endpoint https://gitlab.com/oauth/token
Get User Info Endpoint https://gitlab.com/api/v4/user

Verify SSO Connection and Mapping:

  • In Summary, You will be able to review the configuration which you have done so far.
  • Once verified, you can click on the Test Configuration button to check the connection between Drupal and GitLab.
  • After a successful connection, select the Email Attribute from the dropdown and click on the Done button.

    Drupal OAuth Login - Test configuration

  • Congratulations! You have successfully configured GitLab as OAuth Provider and Drupal as OAuth login.
  • Now, open a new browser/private window and go to your Drupal site login page.
  • Click on the Login using GitLab link to initiate the SSO from Drupal.

Support:

Need assistance? Contact our 24*7 support team

If you require any help with installing or configuring this module, please feel free to reach out to us at our 24*7 Support by clicking on the Support Icon from the bottom right corner and send us a query. You can also join us on Drupal Slack in the #miniorange channel.

 Get In Touch With Us Join Our Slack Channel

back to top Back to top