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.

timewasted's avatar
83
timewasted
asked 2012-04-11 15:32:04 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment 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)
timewasted's avatar
83
timewasted
answered 2012-04-12 13:04:48 -0600, updated 2012-04-12 16:39:03 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments