[EMAIL PROTECTED] wrote:
> I want to create a bunch of Session Attributes during login. Mostly
> attrs from Active Directory that need to be available without too many
> additional calls to the LDAP server.
>
> User attempts log in -> 3rd party login backend is called -> session is
> also passed to the 3rd party backend -> session key[values] are added.
> Done.
>
> I was thinking the session object could also be passed into
> authenticate(), but I didn't look at it too long as it would require
> hacking up django itself. If anyone else thinks this might be handy, I
> will be glad to implement it.
>
> Right now I make an additional call to the LDAP server after login, but
> it is a bit kludgey.

Are you using a custom manipulator for your login form?  If so, you
could pass request when instantiating your manipulator object, and save
request as an attribute (through request you have access to the session
data) of the manipulator object.  Now you run the manipulator's
get_validation_errors() method.  I assume you are checking the entered
password with what's on the ldap server, maybe with a check_password()
validator let's say.  Since this check_password() validator hits the
ldap server, just grab all the data you want and save it to
self.request.session at the same time.


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to