Gitlab: LDAP “Invalid credentials”, but credentials are right

前端 未结 3 592
庸人自扰
庸人自扰 2020-12-21 08:39

The following ldapsearch command works, flawlessly.

ldapsearch -LLL -s sub -P 3 -D \"CN=,OU=IT,OU=Non-Users,OU=Users,OU=UserAccount,DC=,DC=com\" -H l

3条回答
  •  庸人自扰
    2020-12-21 09:04

    I too have got "invalid credentials" error while trying to configure LDAP in gitlab. The error is absolutely due to the format of ldap query. And gitlab appln looks for a specific format to bind the user to AD.

    Here is my working configuration

    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: 'LDAP'
      host: ''
      port: 389
      uid: 'sAMAccountName'
      method: 'plain' # "tls" or "ssl" or "plain"
    
      bind_dn: 'CN=,OU=,OU=,...,DC=example,DC=com'
      password: 'My_Password'
      active_directory: true
      allow_username_or_email_login: true
      block_auto_created_users: false
      base: 'DC=example,DC=com'
    

    If you are not sure of bind_dn. Use a AD query tool that provides you the complete bind dn of the user.

提交回复
热议问题