Joseph Kocherhans wrote: >The authentication api has been simplified into 5 functions in >django.contrib.auth.utils > >authenticate(request) >Returns a user if valid credentials were found in the request. > >login(request, user) >Persist a user id and a backend name in the session. This way a user >doesn't have to reauthenticate on every request. > >logout(request) >Remove the persistent user id and backend name from the session. > >authentiate_and_login(request) >Convenience function to authenticate a request and log a user in. >Returns the user object, or None if authentication failed. > >get_current_user(request) >This is automatically called by the AuthenticationMiddleware to set >request.user. Someone may wish to import and call it, but I don't see >why. > > How do you like the idea of making auth API work with credentials and not with request? That way it's possible to use authentication in non-web environment (think of maintanance scripts from cron). In web environment a credential plugin can just automatically populate "request.credentials" and these would go into auth API instead of a plain request.
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~----------~----~----~----~------~----~------~--~---
