Gitlab and ldap integration issue: invalid credentials

I am trying to integrate ldap and gitlab (11.7.5) but the error keeps coming up:
Error: could not authenticate you from ldapmain due to invalid credientials

Unable to figure what could be the possible issue!

Setting in /etc/gitlab/gitlab.rb

gitlab_rails[‘ldap_enabled’] = true
gitlab_rails[‘ldap_servers’] = YAML.load <<-EOS # remember to close this block with ‘EOS’ below
main: # ‘main’ is the GitLab ‘provider ID’ of this LDAP server
label: ‘Gitlab LDAP’
host: ‘’
port: 389
uid: ‘krbtgt’
encryption: ‘plain’
bind_dn: ‘CN=,OU=Service IDs,DC=<—>,DC=COM’
password: ‘’
smartcard_auth: false
active_directory: true
allow_username_or_email_login: true
lowercase_usernames: true
block_auto_created_users: false
base: ‘’
user_filter: ‘’

EE only

group_base: ‘’
admin_group: ‘’
sync_ssh_keys: false
username: [‘uid’, ‘userid’, ‘sAMAccountName’]
email: [‘mail’, ‘email’, ‘userPrincipalName’]

root@falgitlab:/var/log/gitlab# gitlab-rake gitlab:check

Checking GitLab subtasks …

Checking GitLab Shell …

GitLab Shell: … GitLab Shell version >= 8.4.4 ? … OK (8.4.4)
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Redis available via internal API: OK

Access to /var/opt/gitlab/.ssh/authorized_keys: OK
gitlab-shell self-check successful

Checking GitLab Shell … Finished

Checking Gitaly …

Gitaly: … default … OK

Checking Gitaly … Finished

Checking Sidekiq …

Sidekiq: … Running? … yes
Number of Sidekiq processes … 1

Checking Sidekiq … Finished

Checking Incoming Email …

Incoming Email: … Reply by email is disabled in config/gitlab.yml

Checking Incoming Email … Finished

Checking LDAP …

LDAP: … Server: ldapmain
LDAP authentication… Success
LDAP users with access to your GitLab server (only showing the first 100 results)

Checking LDAP … Finished

Checking GitLab App …

Git configured correctly? … yes
Database config exists? … yes
All migrations up? … yes
Database contains orphaned GroupMembers? … no
GitLab config exists? … yes
GitLab config up to date? … yes
Log directory writable? … yes
Tmp directory writable? … yes
Uploads directory exists? … yes
Uploads directory has correct permissions? … yes
Uploads directory tmp has correct permissions? … skipped (no tmp uploads folder yet)
Init script exists? … skipped (omnibus-gitlab has no init script)
Init script up-to-date? … skipped (omnibus-gitlab has no init script)
Projects have namespace: … can’t check, you have no projects
Redis version >= 2.8.0? … yes
Ruby version >= 2.3.5 ? … yes (2.5.3)
Git version >= 2.18.0 ? … yes (2.18.1)
Git user has default SSH configuration? … yes
Active users: … 1
Elasticsearch version 5.6 - 6.x? … skipped (elasticsearch is disabled)

Checking GitLab App … Finished

Checking GitLab subtasks … Finished

root@falgitlab:/var/log/gitlab# gitlab-rake gitlab:env:info

System information
System: Ubuntu 16.04
Proxy: no
Current User: git
Using RVM: no
Ruby Version: 2.5.3p105
Gem Version: 2.7.6
Bundler Version:1.16.6
Rake Version: 12.3.2
Redis Version: 3.2.12
Git Version: 2.18.1
Sidekiq Version:5.2.3
Go Version: unknown

GitLab information
Version: 11.7.5-ee
Revision: ed04633
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
DB Version: 9.6.11
URL: http://gitlab.<—filtered---->.com
HTTP Clone URL: http://gitlab.<—filtered—>.com/some-group/some-project.git
SSH Clone URL: git@gitlab.<—filtered---->.com:some-group/some-project.git
Elasticsearch: no
Geo: no
Using LDAP: yes
Using Omniauth: yes
Omniauth Providers:

GitLab Shell
Version: 8.4.4
Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories
    Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks
    Git: /opt/gitlab/embedded/bin/git

logs in /var/log/gitlab/gitlab-rails/production.log

Started POST “/users/auth/ldapmain/callback” for at 2019-02-26 12:22:31 +0530
Processing by OmniauthCallbacksController#failure as HTML
Parameters: {“utf8”=>“✓”, “authenticity_token”=>"[FILTERED]", “username”=>“himanshu.mathur”, “password”=>"[FILTERED]"}
Redirected to
Completed 302 Found in 8ms (ActiveRecord: 0.8ms | Elasticsearch: 0.0ms)
Started GET “/users/sign_in” for at 2019-02-26 12:22:31 +0530
Processing by SessionsController#new as HTML
Completed 200 OK in 354ms (Views: 294.1ms | ActiveRecord: 6.4ms | Elasticsearch: 0.0ms)
Started GET “/-/metrics” for at 2019-02-26 12:22:41 +0530

Try changing uid: ‘krbtgt’ to uid: ‘sAMAccountName’ in your gitlab.rb file

You solve the problem? I having the same issue…