Login via GitLab
How to configure OAuth2 login via GitLab
To let your users sign in with their GitLab account, follow the below steps.
- Go to your GitLab account, then navigate to Settings ⇒ Applications.
- Click Add new application:
- 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
- Click Save application: you’ll be presented an Application ID and a Secret. Store them in a safe place for future reference:
- Click Continue.
- Update the secrets configuration with the above data, putting the Application ID into
key
and the Secret intosecret
:
...
idp:
gitlab:
key: a5d56d29e8ca6e7529db59d8dbf465f849249d25e9c23eed123df4ab8dfe394a
secret: gloas-1500310db5b494903117945ac7a20cfec423e7e34fa0c2fcd337e1dafc3ee957
...
- Restart Comentario. You should now see GitLab under Configured federated identity providers on the Static configuration page of the Administration UI.
- Still in the Admin UI, navigate to the desired domain properties and tick off GitLab on the Authentication tab, then click Save.
That’s it! Your users should now be able to login using the GitLab button in the Login dialog.