wildfly/wildfly — pull request #5570 by wojtask9 (2013-12-05 22:26:21+00:00)
Title: add Principal to subject

Principal is only added to subject if we use RemotingConnectionCredential or when there is no Principal at all.
If we have valid principal we forget about it.

This causes org.jboss.security.auth.spi.RoleMappingLoginModule to be broken.
I'm not sure if this fix is correct (we can always get Principal from callbackHandler in LoginModule).

Another question what to do with roles? (JbossCallbackHandler don't contain this information) and what to do with roles added in LoginModule