.setProviderLogin(login)
.setName(this.getName(auth));
this.getEmail(auth).ifPresent(userIdentityBuilder::setEmail);
- userIdentityBuilder.setGroups(this.getGroups(auth));
+ this.getGroups(auth).ifPresent(userIdentityBuilder::setGroups);
return userIdentityBuilder.build();
}
return samlSettings.getUserEmail().map(userEmailField -> getFirstAttribute(auth, userEmailField));
}
- private Set<String> getGroups(Auth auth) {
- return samlSettings.getGroupName().map(groupsField -> getGroups(auth, groupsField)).orElse(emptySet());
+ private Optional<Set<String>> getGroups(Auth auth) {
+ return samlSettings.getGroupName().map(groupsField -> getGroups(auth, groupsField));
}
private static String getNonNullFirstAttribute(Auth auth, String key) {