if (super.commit())
{
Set<Principal> principals = subject.getPrincipals();
Group roleGroup = new JAASGroup(JAASGroup.ROLES);
for (String role : identity.getRoles())
roleGroup.addMember(new RolePrincipal(role));
// group principal
principals.add(roleGroup);
// username principal