Wednesday, March 1, 2017

Re: Djnago User login

+1 for CustomAuth Backend solution.

In runtime Django checks all set backends in the order so I would suggest to put your backend at the beginning of backend's list.

On Thu, Mar 2, 2017 at 12:05 AM, Shawn Milochik <shawn.milo@gmail.com> wrote:
It takes a little fiddling, but you can log in a user however you want.


In short, you can call django.contrib.auth.login(request, user) and force a login without any authentication if you really wanted to. Given that, you can make your own auth backend (subclass the default one) that returns True for certain usernames without checking the value of the password field.


--
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAOzwKwGNmQ9XL6T0Btm%3DhS0iXOasw17YPzZbsgngcRqgSU4b%3DQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK52boXUEmrP1-KrrW-8z0sDL1%3DCO6Ojneh5%3DWUS-Vk5XHsuqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment