Ldap configuration on gitlab error :Could not authenticate you from Ldapmain because “Invalid credentials for username”

0

I have an issue when I try to connect my LDAP to Gitlab:

Could not authenticate you from Ldapmain because "Invalid credentials for username.

This is my file conf /etc/gitlab/gitlab.rb :

```
  gitlab_rails['ldap_enabled'] = true
    gitlab_rails['ldap_servers'] = {
    'main' => {
      'label' => 'GitLab LDAP',
      'host' =>  '<my domain>',
      'port' => 389,
      'uid' => 'uid',
      'encryption' => 'plain',
      'bind_dn' => 'CN=admin,DC=gitlab,DC=com',
      'password' => 'secret',
      'base' => 'OU=users,DC=gitlab,DC=com',
      'block_auto_created_users' => false,
      'allow_username_or_email_login' =>  true

        }
    }
```

From the command line, when I run:


> gitlab-rake gitlab:ldap:check

I can see all my users.

However, when I try to connect on the Gitlab UI, I get the error mentioned above and I’m sure that the password match.

Here’s my log file for reference:

> Parameters: {"utf8"=>" ^ ^ ", "authenticity_token"=>"[FILTERED]", "username"=>"username", "password"=>"[FILTERED]"}
> Redirected to http://mydomain/users/sign_in
> Completed 302 Found in 10ms (ActiveRecord: 1.2ms)

Any help is appreciated!