Skip to content

Fix LDAP sign-in when user cap set

Etienne Baqué requested to merge 341104-fix-ldap-login into master

What does this MR do and why?

Related to #341104 (closed)

The fix this MR introduces is the same fix introduced by this other MR: the fix applied to EE::Gitlab::Auth::Saml::User is now applied to EE::Gitlab::Auth::Ldap::User.

This means that this MR includes quite a bit of refactoring.

Screenshots or screen recordings

Demo posted on Youtube.

How to set up and validate locally

To test this fix locally, we first need to set up a LDAP server. I went for this one: https://github.com/rroemhild/docker-test-openldap

Once this server is set up, update your config/gitlab.yml to include the following:

development:
  ldap:
    enabled: true
    servers:
      main:
        label: 'LDAP'
        host: 'gitlab.local'
        port: 10389
        uid: 'uid'
        encryption: 'plain'
        base: 'dc=planetexpress,dc=com'

Then I logged in in the LDAP tab, with the following user:

  • login: professor
  • password: professor

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #341104 (closed)

Edited by Etienne Baqué

Merge request reports