From be5cd7c35b2edc8ec501c1661fd0462ec85a55cc Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 27 Jun 2022 14:59:47 +0200 Subject: [PATCH] AD users might not have email addresses (#258) --- .../java/com/microsoft/jenkins/azuread/AzureSecurityRealm.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microsoft/jenkins/azuread/AzureSecurityRealm.java b/src/main/java/com/microsoft/jenkins/azuread/AzureSecurityRealm.java index 899de674..911e56fc 100644 --- a/src/main/java/com/microsoft/jenkins/azuread/AzureSecurityRealm.java +++ b/src/main/java/com/microsoft/jenkins/azuread/AzureSecurityRealm.java @@ -510,7 +510,7 @@ public SecurityComponents createSecurityComponents() { List groups = AzureCachePool.get(azureClient) .getBelongingGroupsByOid(user.getObjectID()); - user.setAuthorities(groups, user.getEmail()); + user.setAuthorities(groups, user.getUniqueName()); return user; } catch (GraphServiceException e) { if (e.getResponseCode() == NOT_FOUND) {