First time here? Check out the FAQ!
2

ldap login works during initial login/registration, but fails to recognize existing user if relogging in.
 

I'm setting up a new install of askbot and have everything working, with the exception of ldap. I can log into the system and it correctly authenticates against my ldap server, creating the user account. The problem comes in with logging out of the system. When you go to log back in, it is as if askbot doesn't recognize that the user is already registered in askbot. if you attempt to put your display name and email address back in, you get a duplicate key error.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
timewasted's avatar
83
timewasted
asked 13 years ago

Comments

see more comments

1 Answer

1

I was able to figure this out. in askbot/deps/django_authopenid/backends.py, I had to add a line to bind to the server (our server requires authentication prior to being able to search the tree).

 32         user_filter = "({0}={1})".format(askbot_settings.LDAP_USERID_FIELD,
 33                                          username)
 34 
 35         # Attempt at doing a simple bind to the ldap server
 36         # This is needed before being alllowed to search the ldap tree
 37         ldap_session.simple_bind_s("full_path_to_admin_user", "password")
 38 
 39         # search ldap directory for user
 40         res = ldap_session.search_s(askbot_settings.LDAP_BASEDN, ldap.SCOPE_SUBTREE, user_filter, None)

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
timewasted's avatar
83
timewasted
answered 13 years ago, updated 13 years ago
link

Comments

see more comments