Actually, I am using  django.contrib.auth "backends" style
login/validation. This makes it so I do not have to implement the
actual login request processing, only provide a backend class that
offers  authenticate() and get_user() methods.

perhaps a third function can be optional: add_to_session(dict) ?

david


Gary Wilson wrote:
> [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