Hi all,
I figured out the problem I was having, the example in the documentation I followed for doing the authentication backend didn't have the first 'self' argument, so the authentication was never triggered. Mike On 2/10/2007, "Mike H" <[EMAIL PROTECTED]> wrote: > > >Hi all, > >I am putting together a system where logging in and out is triggered by >calls from a seperate application. > >The other application posts a username and a session id to my >application, and sets a cookie so that when the user visits my site, my >app sees the cookie, looks up which username is associated with that >session id and logs them in. So far, this works fine and my application >can see the cookie and look up the related user with no problems. > >I have a middleware class that detects for the cookie and tries to >authenticate the user, and it looks like this : > > > >from django.contrib.auth import authenticate >from combie.sso.models import SsoSession > >class SsoAuthenticatedMiddleware(object): > def process_request(self, request): > if 'COMBIE_SESSION_ID' in request.COOKIES: > identifier = request.COOKIES['COMBIE_SESSION_ID'] > session = >SsoSession.objects.get(session_identifier=identifier) > user = authenticate(username=session.user.username, >password='combiepass') > login(request, user) > return None > >I've tried many different ways but either it fails to authenticate >silently or complains about no "backend" attribute. > >Has anyone got a better solution to this? > >Many thanks. > >Mike > >> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@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-users?hl=en -~----------~----~----~----~------~----~------~--~---