/**
* Special Case: Invocation has no principal set,
* but an unauthenticatedPrincipal has been configured in JBoss DD
*/
Principal userPrincipal = sc.getUtil().getUserPrincipal();
String unauthenticatedPrincipal = domain.unauthenticatedPrincipal();
if(userPrincipal == null && unauthenticatedPrincipal !=null &&
unauthenticatedPrincipal.length() > 0)
{
Identity unauthenticatedIdentity = new SimpleIdentity(unauthenticatedPrincipal);
sc.getSubjectInfo().addIdentity(unauthenticatedIdentity);