{"action":"created","issue":{"url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/6180","labels_url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/6180/labels{/name}","comments_url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/6180/comments","events_url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/6180/events","html_url":"https://github.com/gitlabhq/gitlabhq/issues/6180","id":26426213,"number":6180,"title":"LDAP login in 6.5 not working if user in LDAP does not have email address","user":{"login":"RaymiiOrg","id":1927494,"avatar_url":"https://avatars.githubusercontent.com/u/1927494?v=3","gravatar_id":"","url":"https://api.github.com/users/RaymiiOrg","html_url":"https://github.com/RaymiiOrg","followers_url":"https://api.github.com/users/RaymiiOrg/followers","following_url":"https://api.github.com/users/RaymiiOrg/following{/other_user}","gists_url":"https://api.github.com/users/RaymiiOrg/gists{/gist_id}","starred_url":"https://api.github.com/users/RaymiiOrg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaymiiOrg/subscriptions","organizations_url":"https://api.github.com/users/RaymiiOrg/orgs","repos_url":"https://api.github.com/users/RaymiiOrg/repos","events_url":"https://api.github.com/users/RaymiiOrg/events{/privacy}","received_events_url":"https://api.github.com/users/RaymiiOrg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gitlabhq/gitlabhq/labels/LDAP","name":"LDAP","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2014-01-28T09:34:49Z","updated_at":"2015-02-24T14:01:40Z","closed_at":null,"body":"Issue: After the upgrade to 6.5 all users in LDAP without an email address attribute are unable to login. We have some users who do need access to gitlab but do not have an email address attribute in Active Directory (2008). This was working with 6.4.\r\n\r\nExpected behaviour: users without email address attribute should be able to login to gitlab.\r\n\r\nWorkaround: adding the email address attribute to the AD account works, after that the user can login. When the email address is removed from AD the user cannot login anymore.\r\n\r\nproduction.log:\r\n\r\n\tProcessing by OmniauthCallbacksController#failure as HTML\r\n\r\n\tParameters: {\"utf8\"=>\"✓\", \"authenticity_token\"=>\"-\", \"username\"=>\"user@example.tld\", \"password\"=>\"[FILTERED]\"}\r\n\r\n\tRedirected to https://<gitlab>.tld/users/sign_in\r\n\r\n\tCompleted 302 Found in 84ms (ActiveRecord: 0.0ms)\r\n\r\n\tStarted GET \"/users/sign_in\" for 127.0.0.1 at 2014-01-28 10:19:10 +0100\r\n\r\n\r\nunicorn.stdout.log:\r\n\r\n    E, [2014-01-28T10:20:23.289767 #30850] ERROR -- omniauth: (ldap) Authentication failure! ldap_error: OmniAuth::Error, (LDAP) Account must provide an uid and email address\r\n    I, [2014-01-28T10:23:28.844448 #30850]  INFO -- omniauth: (ldap) Callback phase initiated.\r\n\r\nRelevant config:\r\n\r\n\t  ldap:\r\n\t    enabled: true\r\n\t    host: '<ip>'\r\n\t    base: 'CN=Users,DC=example,DC=tld'\r\n\t    port: 389\r\n\t    uid: 'sAMAccountName'\r\n\t    method: 'plain' \r\n\t    bind_dn: 'CN=Gitlab LDAP,CN=Users,DC=Example,DC=tld'\r\n\t    password: 'password'\r\n\t    allow_username_or_email_login: true\r\n\r\n`bundle exec rake gitlab:check RAILS_ENV=production` returns LDAP users, even the ones without email address attributes. All other checks pass.\r\n\r\nInformation:\r\n\r\n\tbundle exec rake gitlab:env:info RAILS_ENV=production\r\n\r\n\tSystem information\r\n\tSystem:\t\tUbuntu 12.04\r\n\tCurrent User:\tgit\r\n\tUsing RVM:\tno\r\n\tRuby Version:\t2.0.0p353\r\n\tGem Version:\t2.0.14\r\n\tBundler Version:1.3.5\r\n\tRake Version:\t10.1.0\r\n\r\n\tGitLab information\r\n\tVersion:\t6.5.1\r\n\tRevision:\t6f6f158\r\n\tDirectory:\t/home/git/gitlab\r\n\tDB Adapter:\tmysql2\r\n\tURL:\t\thttps://<gitlab>.tld\r\n\tHTTP Clone URL:\thttps://<gitlab>.tld/some-project.git\r\n\tSSH Clone URL:\tgit@<gitlab>.tld:some-project.git\r\n\tUsing LDAP:\tyes\r\n\tUsing Omniauth:\tno\r\n\r\n\tGitLab Shell\r\n\tVersion:\t1.8.0\r\n\tRepositories:\t/home/git/repositories/\r\n\tHooks:\t\t/home/git/gitlab-shell/hooks/\r\n\tGit:\t\t/usr/bin/git"},"comment":{"url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/comments/75760592","html_url":"https://github.com/gitlabhq/gitlabhq/issues/6180#issuecomment-75760592","issue_url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/6180","id":75760592,"user":{"login":"sohooo","id":9844,"avatar_url":"https://avatars.githubusercontent.com/u/9844?v=3","gravatar_id":"","url":"https://api.github.com/users/sohooo","html_url":"https://github.com/sohooo","followers_url":"https://api.github.com/users/sohooo/followers","following_url":"https://api.github.com/users/sohooo/following{/other_user}","gists_url":"https://api.github.com/users/sohooo/gists{/gist_id}","starred_url":"https://api.github.com/users/sohooo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sohooo/subscriptions","organizations_url":"https://api.github.com/users/sohooo/orgs","repos_url":"https://api.github.com/users/sohooo/repos","events_url":"https://api.github.com/users/sohooo/events{/privacy}","received_events_url":"https://api.github.com/users/sohooo/received_events","type":"User","site_admin":false},"created_at":"2015-02-24T14:01:40Z","updated_at":"2015-02-24T14:01:40Z","body":"+1, same behaviour with OpenLDAP: `(LDAP) Account must provide an uid and email address`"}}