/** * This method returns a {@link Set} of groups loaded for the user during the authentication step. * * Note: Groups are also assumed to be specific to the realm. * * @return The {@link Set} of groups loaded during authentication or an empty {@link Set} if none were loaded. */ public Set<String> getAssociatedGroups() { if (groups == null) { if (securityIdentity != null) { groups = StreamSupport.stream(securityIdentity.getRoles().spliterator(), true).collect(Collectors.toSet()); } else { this.groups = Collections.emptySet(); } } return groups; }
/** * This method returns a {@link Set} of groups loaded for the user during the authentication step. * * Note: Groups are also assumed to be specific to the realm. * * @return The {@link Set} of groups loaded during authentication or an empty {@link Set} if none were loaded. */ public Set<String> getAssociatedGroups() { if (groups == null) { if (securityIdentity != null) { groups = StreamSupport.stream(securityIdentity.getRoles().spliterator(), true).collect(Collectors.toSet()); } else { this.groups = Collections.emptySet(); } } return groups; }
principal = securityIdentity.getPrincipal(); realm = principal instanceof RealmPrincipal ? ((RealmPrincipal) principal).getRealm() : null; roles = StreamSupport.stream(securityIdentity.getRoles().spliterator(), false).collect(Collectors.toSet()); } else { principal = null;
principal = securityIdentity.getPrincipal(); realm = principal instanceof RealmPrincipal ? ((RealmPrincipal) principal).getRealm() : null; roles = StreamSupport.stream(securityIdentity.getRoles().spliterator(), false).collect(Collectors.toSet()); } else { principal = null;