Login via GitLab

How to configure OAuth2 login via GitLab

To let your users sign in with their GitLab account, follow the below steps.

  1. Go to your GitLab account, then navigate to Settings ⇒ Applications.
  2. Click Add new application:
    Image
  3. Fill in application details:
    • Application name
    • Redirect URI: set to https://<your-comentario-domain>/api/oauth/gitlab/callback
    • Enable Confidential
    • Enable the read_user scope
      Image
  4. Click Save application: you’ll be presented an Application ID and a Secret. Store them in a safe place for future reference:
    Image
  5. Click Continue.
  6. Update the secrets configuration with the above data, putting the Application ID into key and the Secret into secret:
...
idp:
  gitlab:
    key:    a5d56d29e8ca6e7529db59d8dbf465f849249d25e9c23eed123df4ab8dfe394a
    secret: gloas-1500310db5b494903117945ac7a20cfec423e7e34fa0c2fcd337e1dafc3ee957
...
  1. Restart Comentario. You should now see GitLab under Configured federated identity providers on the Static configuration page of the Administration UI.
  2. Still in the Admin UI, navigate to the desired domain properties and tick off GitLab on the Authentication tab, then click Save.
    Image

That’s it! Your users should now be able to login using the GitLab button in the Login dialog.

See also