SAMLAssertion assertion;
// In the case where the principal is a UT
if (principal instanceof WSUsernameTokenPrincipal) {
SAMLNameIdentifier nameId = null;
if(config.getCallbackHandler() != null){
SAMLNameIdentifierCallback cb = new SAMLNameIdentifierCallback(data);
cb.setUserId(principal.getName());
SAMLCallbackHandler callbackHandler = config.getCallbackHandler();
callbackHandler.handle(cb);
nameId = cb.getNameId();
}else{
nameId = new SAMLNameIdentifier(
principal.getName(), null, SAMLNameIdentifier.FORMAT_EMAIL);
}
assertion = createAuthAssertion(doc, SAMLSubject.CONF_BEARER,