mirror of
https://github.com/ansible/awx.git
synced 2026-03-28 22:35:08 -02:30
Co-authored-by: David Newswanger <gamma.dave@gmail.com>
This commit is contained in:
@@ -14,6 +14,7 @@ from django.contrib.auth.models import User
|
|||||||
from django.conf import settings as django_settings
|
from django.conf import settings as django_settings
|
||||||
from django.core.signals import setting_changed
|
from django.core.signals import setting_changed
|
||||||
from django.utils.encoding import force_str
|
from django.utils.encoding import force_str
|
||||||
|
from django.http import HttpResponse
|
||||||
|
|
||||||
# django-auth-ldap
|
# django-auth-ldap
|
||||||
from django_auth_ldap.backend import LDAPSettings as BaseLDAPSettings
|
from django_auth_ldap.backend import LDAPSettings as BaseLDAPSettings
|
||||||
@@ -316,7 +317,13 @@ class SAMLAuth(BaseSAMLAuth):
|
|||||||
]
|
]
|
||||||
):
|
):
|
||||||
return None
|
return None
|
||||||
user = super(SAMLAuth, self).authenticate(request, *args, **kwargs)
|
pipeline_result = super(SAMLAuth, self).authenticate(request, *args, **kwargs)
|
||||||
|
|
||||||
|
if isinstance(pipeline_result, HttpResponse):
|
||||||
|
return pipeline_result
|
||||||
|
else:
|
||||||
|
user = pipeline_result
|
||||||
|
|
||||||
# Comes from https://github.com/omab/python-social-auth/blob/v0.2.21/social/backends/base.py#L91
|
# Comes from https://github.com/omab/python-social-auth/blob/v0.2.21/social/backends/base.py#L91
|
||||||
if getattr(user, 'is_new', False):
|
if getattr(user, 'is_new', False):
|
||||||
enterprise_auth = _decorate_enterprise_user(user, 'saml')
|
enterprise_auth = _decorate_enterprise_user(user, 'saml')
|
||||||
|
|||||||
Reference in New Issue
Block a user