Date expirationTime, RahasData data) throws TrustException {
try {
Principal principal = data.getPrincipal();
// In the case where the principal is a UT
if (principal instanceof WSUsernameTokenPrincipal) {
SAMLNameIdentifier nameId = null;
if(config.getCallbackHander() != null){
SAMLNameIdentifierCallback cb = new SAMLNameIdentifierCallback(data);
cb.setUserId(principal.getName());
SAMLCallbackHandler callbackHandler = config.getCallbackHander();
callbackHandler.handle(cb);
nameId = cb.getNameId();
}else{
nameId = new SAMLNameIdentifier(
principal.getName(), null, SAMLNameIdentifier.FORMAT_EMAIL);
}
return createAuthAssertion(doc, SAMLSubject.CONF_BEARER,
nameId, null, config, crypto, creationTime,