/** * Gets the roles the user belongs to. */ @Override protected Group[] getRoleSets() throws LoginException { log.debug("getRoleSets"); if (manager == null) { // throw new LoginException("UserManager implementation not found"); } String username = identity.getName(); List<String> roles = identity.getRoles(); Group roleSet = new GroupImpl("Roles"); log.debug("Getting roles for user=" + username); for (String roleName : roles) { Principal role = new PrincipalImpl(roleName); log.debug("Found role=" + roleName); roleSet.addMember(role); } Group callerPrincipal = new GroupImpl("CallerPrincipal"); callerPrincipal.addMember(identity); return new Group[] { roleSet, callerPrincipal }; }