[Django] #24855: Allow the use of django.contrib.auth.login without credentials (authentication)

18 views
Skip to first unread message

Django

unread,
May 25, 2015, 9:32:43 PM5/25/15
to django-...@googlegroups.com
#24855: Allow the use of django.contrib.auth.login without credentials
(authentication)
------------------------------+--------------------
Reporter: poiati | Owner: nobody
Type: New feature | Status: new
Component: contrib.auth | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------
As it is we need to call `authenticate` before `login` because we need to
set the authentication backend in the user model. We can use login without
authenticate if we set the backend attr manually, but this need some
implementation knowledge of how authentication works.

The proposal is to change the `login` function signature to:

`login(request, user, backend=None)`

The following rules will apply:

1. Use the value of the `backend` argument, if provided.
2. Use the value of the `user.backend` annotation, if present.
3. Use the only configured backend, if there is only one.
4. Raise ValueError("You have multiple authentication backends configured;
you must provide the backend argument to login.") otherwise.

More information can be found in the mailing list topic:

https://groups.google.com/forum/#!topic/django-developers/_I0BW5L7Z58

--
Ticket URL: <https://code.djangoproject.com/ticket/24855>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 25, 2015, 9:34:10 PM5/25/15
to django-...@googlegroups.com
#24855: Allow the use of django.contrib.auth.login without credentials
(authentication)
------------------------------+--------------------------------------
Reporter: poiati | Owner: poiati
Type: New feature | Status: assigned
Component: contrib.auth | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Changes (by poiati):

* status: new => assigned
* needs_docs: => 0
* owner: nobody => poiati
* needs_tests: => 0
* needs_better_patch: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/24855#comment:1>

Django

unread,
May 25, 2015, 10:34:21 PM5/25/15
to django-...@googlegroups.com
#24855: Allow the use of django.contrib.auth.login without credentials
(authentication)
------------------------------+------------------------------------

Reporter: poiati | Owner: poiati
Type: New feature | Status: assigned
Component: contrib.auth | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------
Changes (by timgraham):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/24855#comment:2>

Django

unread,
Sep 27, 2015, 1:00:17 PM9/27/15
to django-...@googlegroups.com
#24855: Allow the use of django.contrib.auth.login without credentials
(authentication)
------------------------------+------------------------------------
Reporter: poiati | Owner: poiati
Type: New feature | Status: assigned
Component: contrib.auth | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------

Comment (by poiati):

Patch: https://github.com/django/django/pull/5370

--
Ticket URL: <https://code.djangoproject.com/ticket/24855#comment:3>

Django

unread,
Sep 27, 2015, 1:00:28 PM9/27/15
to django-...@googlegroups.com
#24855: Allow the use of django.contrib.auth.login without credentials
(authentication)
------------------------------+------------------------------------
Reporter: poiati | Owner: poiati
Type: New feature | Status: assigned
Component: contrib.auth | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------
Changes (by poiati):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/24855#comment:4>

Django

unread,
Sep 28, 2015, 11:20:16 AM9/28/15
to django-...@googlegroups.com
#24855: Allow the use of django.contrib.auth.login without credentials
(authentication)
------------------------------+------------------------------------
Reporter: poiati | Owner: poiati
Type: New feature | Status: assigned
Component: contrib.auth | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------
Changes (by carljm):

* needs_docs: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/24855#comment:5>

Django

unread,
Oct 7, 2015, 11:27:41 AM10/7/15
to django-...@googlegroups.com
#24855: Allow the use of django.contrib.auth.login without credentials
(authentication)
------------------------------+------------------------------------
Reporter: poiati | Owner: poiati
Type: New feature | Status: assigned
Component: contrib.auth | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------

Comment (by poiati):

Replying to [comment:5 carljm]:

The documentation was updated .

--
Ticket URL: <https://code.djangoproject.com/ticket/24855#comment:6>

Django

unread,
Oct 7, 2015, 11:33:20 AM10/7/15
to django-...@googlegroups.com
#24855: Allow the use of django.contrib.auth.login without credentials
(authentication)
------------------------------+------------------------------------
Reporter: poiati | Owner: poiati
Type: New feature | Status: assigned
Component: contrib.auth | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------
Changes (by timgraham):

* needs_docs: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/24855#comment:7>

Django

unread,
Oct 21, 2015, 3:37:22 PM10/21/15
to django-...@googlegroups.com
#24855: Allow the use of django.contrib.auth.login without credentials
(authentication)
------------------------------+------------------------------------
Reporter: poiati | Owner: poiati
Type: New feature | Status: assigned
Component: contrib.auth | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/24855#comment:8>

Django

unread,
Jan 4, 2016, 10:04:17 PM1/4/16
to django-...@googlegroups.com
#24855: Allow the use of django.contrib.auth.login without credentials
(authentication)
------------------------------+------------------------------------
Reporter: poiati | Owner: poiati
Type: New feature | Status: assigned
Component: contrib.auth | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------
Changes (by poiati):

* needs_better_patch: 1 => 0


Comment:

I applied the corrections in the PR.

--
Ticket URL: <https://code.djangoproject.com/ticket/24855#comment:9>

Django

unread,
Jan 7, 2016, 8:56:44 AM1/7/16
to django-...@googlegroups.com
#24855: Allow the use of django.contrib.auth.login without credentials
(authentication)
------------------------------+------------------------------------
Reporter: poiati | Owner: poiati
Type: New feature | Status: closed
Component: contrib.auth | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"b6433866682baac35a953e59298dff7f399ac49b" b643386]:
{{{
#!CommitTicketReference repository=""
revision="b6433866682baac35a953e59298dff7f399ac49b"
Fixed #24855 -- Allowed using contrib.auth.login() without credentials.

Added an optional `backend` argument to login().
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24855#comment:10>

Django

unread,
Jan 7, 2016, 11:39:11 AM1/7/16
to django-...@googlegroups.com
#24855: Allow the use of django.contrib.auth.login without credentials
(authentication)
------------------------------+------------------------------------
Reporter: poiati | Owner: poiati
Type: New feature | Status: closed
Component: contrib.auth | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"6ea7b6776c79b7a30b32c4f0c1f2658bc49dfe6c" 6ea7b67]:
{{{
#!CommitTicketReference repository=""
revision="6ea7b6776c79b7a30b32c4f0c1f2658bc49dfe6c"
Refs #24855 -- fixed typo in 1.10 release notes
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24855#comment:11>

Reply all
Reply to author
Forward
0 new messages