Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

LDAP: providers dict does not have 'ldap'

I have a working AskBot system on CentOS 6.x, askbot version 0.7.53, so I have successfully used LDAP before. However, I am trying to install a completely new AskBot (not upgrade) on a different server, Ubuntu 16.04, askbot version 0.10.0, and I cannot get LDAP working on the new system.

I only want LDAP login and local login. I have turned off all others. I have the following settings:

  • Login provider settings: "Activate local password login" is checked
  • Login provider settings: "Activate ??? login" for AOL,Blogger,ClaimID,Facebook,etc. are all unchecked
  • LDAP login configuration: "Use LDAP authentication for the password login" is checked

I'm using runserver to debug. I can use pdb.set_trace() to gather more information, if that would help. When I try to login using my admin user (local login), it works fine. When I try to login using LDAP, I get a KeyError (see below). Note that if I hack the code to get past this error, thus allowing AskBot to create the new user in its tables, I do not hit the error again. It apparently only happens during the initial login via LDAP. But my hack is not usable; I just did it to see if the login would work.


Request Method: POST
Request URL: .../account/signin/

Django Version: 1.8.13
Python Version: 2.7.11
Installed Applications:
Installed Middleware:

File "/opt/virtenvs/askbot/local/lib/python2.7/site-packages/django/core/handlers/" in get_response
  132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/virtenvs/askbot/local/lib/python2.7/site-packages/django/utils/" in _wrapped_view
  110.                     response = view_func(request, *args, **kwargs)
File "/opt/virtenvs/askbot/local/lib/python2.7/site-packages/askbot/deps/django_authopenid/" in signin
  484.                                     redirect_url = next_url
File "/opt/virtenvs/askbot/local/lib/python2.7/site-packages/askbot/deps/django_authopenid/" in finalize_generic_signin
  1012.                     redirect_url=redirect_url
File "/opt/virtenvs/askbot/local/lib/python2.7/site-packages/askbot/deps/django_authopenid/" in decorated
  234.         return func(request, *args, **kwargs)
File "/opt/virtenvs/askbot/local/lib/python2.7/site-packages/django/utils/" in _wrapped_view
  110.                     response = view_func(request, *args, **kwargs)
File "/opt/virtenvs/askbot/local/lib/python2.7/site-packages/askbot/deps/django_authopenid/" in register
  1045.         provider_data = providers[login_provider_name]

Exception Type: KeyError at /account/signin/
Exception Value: 'ldap'

The 'providers' dictionary only has one key in it at the time of this attempted dictionary access: local. The code expects an ldap key, which is absent. I have looked at my working system over and over and cannot find a setting that might be missing from new system. I have read and re-read the documentation on using LDAP and cannot find the piece I'm missing.

Anybody have an idea?

Thanks, David