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) {