sources/oauth: use UPN for username with azure AD source
closes #3468 breaking Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
e994a01e80
commit
13a302cdad
|
@ -41,6 +41,6 @@ class TestTypeAzureAD(TestCase):
|
|||
def test_enroll_context(self):
|
||||
"""Test azure_ad Enrollment context"""
|
||||
ak_context = AzureADOAuthCallback().get_user_enroll_context(AAD_USER)
|
||||
self.assertEqual(ak_context["username"], AAD_USER["displayName"])
|
||||
self.assertEqual(ak_context["username"], AAD_USER["userPrincipalName"])
|
||||
self.assertEqual(ak_context["email"], AAD_USER["mail"])
|
||||
self.assertEqual(ak_context["name"], AAD_USER["displayName"])
|
||||
|
|
|
@ -31,7 +31,7 @@ class AzureADOAuthCallback(OAuthCallback):
|
|||
) -> dict[str, Any]:
|
||||
mail = info.get("mail", None) or info.get("otherMails", [None])[0]
|
||||
return {
|
||||
"username": info.get("displayName"),
|
||||
"username": info.get("userPrincipalName"),
|
||||
"email": mail,
|
||||
"name": info.get("displayName"),
|
||||
}
|
||||
|
|
Reference in a new issue