9596979899100101102103104105
{ Set<Principal> principals = subject.getPrincipals(); for (String role : identity.getRoles()) principals.add(new RolePrincipal(role)); // username principal principals.add(new UserPrincipal(identity.getUserId())); return true;