[SOLVED] Successful LDAP authentication gives "Undefined method `to sym' for nil:nilclass did you mean? to s"

Can someone please help me resolve this issue? Its really important to get this implemented in convincing the boss we should use gitlab :slight_smile:

  • if I enter a fake user - I get a valid response “Incorrect credentials”
  • if I enter correct credentials the user gets the error and cannot login
  • I asked a colleague to try his account which is not related to an existing user in gitlab - he also gets the error but I can see in git lab the account is at least created

Oh wow - I dont know how many combinations I have played with but found something that works

gitlab_rails['ldap_servers'] = YAML.load <<-'EOS' # remember to close this block with 'EOS' below
   main:
     label: 'LDAP'
     host: 'host.myco.com'
     port: 389
     uid: 'uid'
     method: 'plain'
     bind_dn: ''
     password: ''
     active_directory: false
     allow_username_or_email_login: false
     block_auto_created_users: false
     base: 'o=myco.com'
     user_filter: ''
     attributes:
       username: 'uid'
       email:    'mail'
       name:       'cn'
#      first_name: 'givenName'
#      last_name:  'sn'
#    group_base: ''
#    admin_group: ''
EOS

I am not sure if it was the indenting that worked (so many examples around the web and the documentation saying how important the indentation is - yet there are examples with 1 space, 2 space, and finally this one that worked with 3 spaces for main and then 2 for the rest!)

Or perhaps its because I was more verbose - i.e. specifying empty values for each instead of commenting.

Either way - the whole thing is a mess and should be a lot easier!! :slight_smile: Why can’t it be configured in the GUI???

I had the same issue, but connecting to a LDAP server.

By removing all the unusefull stuff it finally worked. The error message is really unclear. (Gitlab developers… please put more precise errors).

My issue was in the attributes, by doing the following it started to work:

    attributes:
      # username: ['uid', 'userid', 'sAMAccountName'] 
      username: ['sAMAccountName']
      # email:    ['mail', 'email', 'userPrincipalName']
      email:    ['mail']
      name:       'cn'
      first_name: 'givenName'
      last_name:  'sn'