title: Gitlab Ldap Authentication Settings
body: <h2>Current Environment:</h2>
  
  <ul>
  <li><strong>Gitlab Server:</strong> Centos 6.5</li>
  <li><strong>Active Directory:</strong> Windows Server 2008 R2</li>
  </ul>
  
  <p>Could anyone check these fictitious settings for Ldap authentication in Gitlab 7.1.1?</p>
  
  <pre><code>gitlab_rails['ldap_enabled'] = true
  gitlab_rails['ldap_host'] = 'myserver.dom.com.net'
  gitlab_rails['ldap_port'] = 389
  gitlab_rails['ldap_uid'] = 'sAMAccountName'
  gitlab_rails['ldap_method'] = 'plain' # 'ssl' or 'plain'
  gitlab_rails['ldap_bind_dn'] = 'OU=Users,DC=dom,DC=com,DC=net'
  gitlab_rails['ldap_password'] = '????'
  gitlab_rails['ldap_allow_username_or_email_login'] = true
  gitlab_rails['ldap_base'] = 'DC=dom,DC=com,DC=net'
  </code></pre>
  
  <p>Which <strong>ldap_bind_dn</strong> has to be set in order to Gitlab works (user account equivalent)?</p>
  
  <p>Which <strong>ldap_password</strong> has to be set in order to Gitlab works?</p>
  
  <p>I followed suggestions from: @metaDiego and @heinglandreas. Both were in the right path. So I modified my settings in the lines:</p>
  
  <h2>Solution</h2>
  
  <pre><code>gitlab_rails['ldap_bind_dn'] = 'CN=the_allowed_user_for_access_ldap,OU=Users,DC=dom,DC=com,DC=net'
  gitlab_rails['ldap_password'] = 'the_password_of_allowed_user'
  </code></pre>
  
  <p>The <strong>ldap_bind_dn</strong> may vary according to the AD structure and the current level where the allowed user is located.</p>
  
  <p>My company AD doesn't allow anonymous Ldap queries. So adding those parameters were mandatory.</p>
  
  <p>Search help in the domain administrators, for getting those parameters. </p>
  
  <p>Useful article from <a href="https://github.com/patthoyts/gitlabhq/wiki/Setting-up-ldap-auth" rel="noreferrer">gitlabhq</a> at Github</p>
  
  <p>If <code>gitlab_rails['ldap_allow_username_or_email_login'] = true</code>, the login user could be with email format or only domain user.</p>
  
  <p><img src="https://i.stack.imgur.com/7WeXU.jpg" alt="Gitlab authentication form"></p>