Skip to content

Commit a3bfdf2

Browse files
authored
Merge pull request #62 from terite/django-1.11-authenticate
pass request to auth.authenticate
2 parents 1ea8a92 + 60dede4 commit a3bfdf2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

djangosaml2/backends.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def get_saml_user_model():
6868

6969
class Saml2Backend(ModelBackend):
7070

71-
def authenticate(self, session_info=None, attribute_mapping=None,
71+
def authenticate(self, request, session_info=None, attribute_mapping=None,
7272
create_unknown_user=True, **kwargs):
7373
if session_info is None or attribute_mapping is None:
7474
logger.error('Session info or attribute mapping are None')

djangosaml2/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ def assertion_consumer_service(request,
276276
create_unknown_user = create_unknown_user()
277277

278278
logger.debug('Trying to authenticate the user')
279-
user = auth.authenticate(session_info=session_info,
279+
user = auth.authenticate(request=request,
280+
session_info=session_info,
280281
attribute_mapping=attribute_mapping,
281282
create_unknown_user=create_unknown_user)
282283
if user is None:

0 commit comments

Comments
 (0)