mirror of
https://github.com/ansible/awx.git
synced 2026-05-05 00:25:29 -02:30
Merge branch 'release_3.2.0' into devel
* release_3.2.0: (66 commits) fix workflow maker lookup issues adding extra logic check for ansible_facts in smart search adding "admin_role" as a default query param for insights cred lookup changing insights cred lookup to not use hard coded cred type fix rounding of capacity percentage Catch potential unicode errors when looking up addrinfo fixing typo with adding query params for instance groups modal move percentage capacitty to variable Add unit test for inventory_sources_already_updated Check for inventory sources already updated from start args Fixed inventory completed jobs pagination bug by setting default page size Remove the logic blocking dependent inventory updates on callbacks fix instance group percentage Remove host-filter-modal import Fix partial hover highlight of host filter modal row Removed leading slash on basePath Fixed host nested groups pagination Added trailing slash to basePath Fixed nested groups pagination Fixed host_filter searching related fields ...
This commit is contained in:
@@ -136,8 +136,7 @@ class LDAPBackend(BaseLDAPBackend):
|
||||
def _decorate_enterprise_user(user, provider):
|
||||
user.set_unusable_password()
|
||||
user.save()
|
||||
enterprise_auth = UserEnterpriseAuth(user=user, provider=provider)
|
||||
enterprise_auth.save()
|
||||
enterprise_auth, _ = UserEnterpriseAuth.objects.get_or_create(user=user, provider=provider)
|
||||
return enterprise_auth
|
||||
|
||||
|
||||
@@ -269,16 +268,12 @@ class SAMLAuth(BaseSAMLAuth):
|
||||
if not feature_enabled('enterprise_auth'):
|
||||
logger.error("Unable to authenticate, license does not support SAML authentication")
|
||||
return None
|
||||
created = False
|
||||
try:
|
||||
user = User.objects.get(username=kwargs.get('username', ''))
|
||||
if user and not user.is_in_enterprise_category('saml'):
|
||||
return None
|
||||
except User.DoesNotExist:
|
||||
created = True
|
||||
user = super(SAMLAuth, self).authenticate(*args, **kwargs)
|
||||
if user and created:
|
||||
# Comes from https://github.com/omab/python-social-auth/blob/v0.2.21/social/backends/base.py#L91
|
||||
if getattr(user, 'is_new', False):
|
||||
_decorate_enterprise_user(user, 'saml')
|
||||
elif user and not user.is_in_enterprise_category('saml'):
|
||||
return None
|
||||
return user
|
||||
|
||||
def get_user(self, user_id):
|
||||
|
||||
Reference in New Issue
Block a user