From fe4ca7eeba969e6f31d0c086f078fc1a8b72fa8f Mon Sep 17 00:00:00 2001
From: Bastian Kleineidam <calvin@debian.org>
Date: Fri, 25 Jan 2008 21:17:53 +0100
Subject: Accept variable keyword args in authentication
Currently authentication functions accept username and password,
but some authentication algorithms may require other types
of credentials (such as public keys or ip addresses).
Thus the authenticate() function should accept variable keyword
arguments to allow such constructs.
Signed-off-by: Bastian Kleineidam <calvin@debian.org>
diff --git a/django/contrib/auth/backends.py b/django/contrib/auth/backends.py
index f79929e..de9b417 100644
a
|
b
|
class ModelBackend:
|
12 | 12 | """ |
13 | 13 | # TODO: Model, login attribute name and password attribute name should be |
14 | 14 | # configurable. |
15 | | def authenticate(self, username=None, password=None): |
| 15 | def authenticate(self, username=None, password=None, **kwargs): |
16 | 16 | try: |
17 | 17 | user = User.objects.get(username=username) |
18 | 18 | if user.check_password(password): |