Skip to content

Commit d8b4957

Browse files
authored
Merge branch 'devel' into add_service_id
2 parents 69d52e2 + 5c15cec commit d8b4957

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ansible_base/authentication/utils/authentication.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ def check_system_username(uid: str) -> None:
9595

9696

9797
def determine_username_from_uid_social(**kwargs) -> dict:
98-
selected_username = kwargs.get('details', {}).get('username', None)
98+
uid_field = getattr(kwargs.get('backend', None), 'ID_KEY', 'username')
99+
selected_username = kwargs.get('details', {}).get(uid_field, None)
99100
if not selected_username:
100101
raise AuthException(_('Unable to get associated username from: %(details)s') % {'details': kwargs.get("details", None)})
101102

0 commit comments

Comments
 (0)