On Mon, Oct 14, 2013 at 1:52 PM, Hanne Moa <[email protected]> wrote:
> I can't get logging in with alternate auth backends to work with Django 1.4
> or newer.
>
> Basically:
>
> 1. authenticate() works. request.user.is_authenticated() is True
> 2. Django's own login() seems to work, as request.user is set,
> request.session is set etc.
> 3. After the HttpResponseRedirect, request.user is AnonymousUser
>
> This has happened twice now, with different alternate auth backends. I can't
> get rid of Django 1.3 before this is fixed...
>
> In one project I can call the next view directly (with render) and it Just
> Works. In the current project, the next view contains a form, and the
> "login" doesn't survive the POST.
>
> What am I missing? See also the non-solution in
> http://stackoverflow.com/questions/16119155/django-request-user-not-set-after-redirect
>

Are you sure sessions are working correctly? Are you setting cookies
(for session or otherwise) with a different host name than you are
serving from?

Use a browser that allows you to inspect and capture web requests
(chrome, firefox etc), capture the login sequence and look at the
cookies that are being set.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1%2BJG9qmAYCk5bEvK%2BOa6YdQ3CiJuKN3gRka6SzfvK7fhw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to