{"action":"created","issue":{"url":"https://api.github.com/repos/tonioo/modoboa/issues/852","repository_url":"https://api.github.com/repos/tonioo/modoboa","labels_url":"https://api.github.com/repos/tonioo/modoboa/issues/852/labels{/name}","comments_url":"https://api.github.com/repos/tonioo/modoboa/issues/852/comments","events_url":"https://api.github.com/repos/tonioo/modoboa/issues/852/events","html_url":"https://github.com/tonioo/modoboa/issues/852","id":141620571,"number":852,"title":" 'NoneType' object is not iterable after a ldap login","user":{"login":"romainreuillon","id":1270995,"avatar_url":"https://avatars.githubusercontent.com/u/1270995?v=3","gravatar_id":"","url":"https://api.github.com/users/romainreuillon","html_url":"https://github.com/romainreuillon","followers_url":"https://api.github.com/users/romainreuillon/followers","following_url":"https://api.github.com/users/romainreuillon/following{/other_user}","gists_url":"https://api.github.com/users/romainreuillon/gists{/gist_id}","starred_url":"https://api.github.com/users/romainreuillon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romainreuillon/subscriptions","organizations_url":"https://api.github.com/users/romainreuillon/orgs","repos_url":"https://api.github.com/users/romainreuillon/repos","events_url":"https://api.github.com/users/romainreuillon/events{/privacy}","received_events_url":"https://api.github.com/users/romainreuillon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-17T15:40:49Z","updated_at":"2016-03-17T16:14:17Z","closed_at":null,"body":"Hi,\r\n\r\nI configured the ldap login using search and bind with the following settings:\r\n\r\nAnnonymous bind\r\nusers search base: ou=People,dc=iscpif,dc=fr\r\nsearch filter: (uid=%(user)s)\r\npassword attribute: userPassword\r\n\r\nIt seems to work since when I enter an login / password not in the ldap modoboa tells \"wrong login / password\", but when I enter a correct login password (for instance login: reuillon, mdp: password), I get this error : \r\n\r\n```\r\nEnvironment:\r\n\r\n\r\nRequest Method: POST\r\nRequest URL: https://mail.iscpif.fr/accounts/login/\r\n\r\nDjango Version: 1.8.11\r\nPython Version: 2.7.6\r\nInstalled Applications:\r\n('django.contrib.auth',\r\n 'django.contrib.contenttypes',\r\n 'django.contrib.sessions',\r\n 'django.contrib.messages',\r\n 'django.contrib.sites',\r\n 'django.contrib.staticfiles',\r\n 'reversion',\r\n 'rest_framework.authtoken',\r\n 'modoboa',\r\n 'modoboa.core',\r\n 'modoboa.lib',\r\n 'modoboa.admin',\r\n 'modoboa.relaydomains',\r\n 'modoboa.limits',\r\n 'modoboa_amavis',\r\n 'modoboa_pdfcredentials',\r\n 'modoboa_postfix_autoreply',\r\n 'modoboa_sievefilters',\r\n 'modoboa_stats',\r\n 'modoboa_webmail')\r\nInstalled Middleware:\r\n('x_forwarded_for.middleware.XForwardedForMiddleware',\r\n 'django.contrib.sessions.middleware.SessionMiddleware',\r\n 'django.middleware.common.CommonMiddleware',\r\n 'django.middleware.csrf.CsrfViewMiddleware',\r\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\r\n 'django.contrib.messages.middleware.MessageMiddleware',\r\n 'django.middleware.locale.LocaleMiddleware',\r\n 'django.middleware.clickjacking.XFrameOptionsMiddleware',\r\n 'modoboa.lib.middleware.AjaxLoginRedirect',\r\n 'modoboa.lib.middleware.CommonExceptionCatcher',\r\n 'modoboa.lib.middleware.RequestCatcherMiddleware')\r\n\r\n\r\nTraceback:\r\nFile \"/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py\" in get_response\r\n  132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)\r\nFile \"/srv/modoboa/env/local/lib/python2.7/site-packages/django/utils/decorators.py\" in inner\r\n  145.                     return func(*args, **kwargs)\r\nFile \"/srv/modoboa/env/local/lib/python2.7/site-packages/django/utils/decorators.py\" in inner\r\n  145.                     return func(*args, **kwargs)\r\nFile \"/srv/modoboa/env/local/lib/python2.7/site-packages/django/views/decorators/cache.py\" in _wrapped_view_func\r\n  57.         response = view_func(request, *args, **kwargs)\r\nFile \"/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/core/views/auth.py\" in dologin\r\n  24.                                 password=form.cleaned_data[\"password\"])\r\nFile \"/srv/modoboa/env/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py\" in authenticate\r\n  74.             user = backend.authenticate(**credentials)\r\nFile \"/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa/lib/authbackends.py\" in authenticate\r\n  75.                 return super(LDAPBackend, self).authenticate(username, password)\r\nFile \"/srv/modoboa/env/local/lib/python2.7/site-packages/django_auth_ldap/backend.py\" in authenticate\r\n  167.         user = ldap_user.authenticate(password)\r\nFile \"/srv/modoboa/env/local/lib/python2.7/site-packages/django_auth_ldap/backend.py\" in authenticate\r\n  339.             self._get_or_create_user()\r\nFile \"/srv/modoboa/env/local/lib/python2.7/site-packages/django_auth_ldap/backend.py\" in _get_or_create_user\r\n  548.         self._user, created = self.backend.get_or_create_user(username, self)\r\n\r\nException Type: TypeError at /accounts/login/\r\nException Value: 'NoneType' object is not iterable\r\n```\r\n\r\nAny idea what goes wrong ?\r\n\r\ncheers,\r\nRomain"},"comment":{"url":"https://api.github.com/repos/tonioo/modoboa/issues/comments/197953385","html_url":"https://github.com/tonioo/modoboa/issues/852#issuecomment-197953385","issue_url":"https://api.github.com/repos/tonioo/modoboa/issues/852","id":197953385,"user":{"login":"romainreuillon","id":1270995,"avatar_url":"https://avatars.githubusercontent.com/u/1270995?v=3","gravatar_id":"","url":"https://api.github.com/users/romainreuillon","html_url":"https://github.com/romainreuillon","followers_url":"https://api.github.com/users/romainreuillon/followers","following_url":"https://api.github.com/users/romainreuillon/following{/other_user}","gists_url":"https://api.github.com/users/romainreuillon/gists{/gist_id}","starred_url":"https://api.github.com/users/romainreuillon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romainreuillon/subscriptions","organizations_url":"https://api.github.com/users/romainreuillon/orgs","repos_url":"https://api.github.com/users/romainreuillon/repos","events_url":"https://api.github.com/users/romainreuillon/events{/privacy}","received_events_url":"https://api.github.com/users/romainreuillon/received_events","type":"User","site_admin":false},"created_at":"2016-03-17T16:14:17Z","updated_at":"2016-03-17T16:14:17Z","body":"PS2: I just tried with non ldap users and everything works fine for the same domain"}}