SAMLCallback samlCallback = new SAMLCallback();
SAMLUtil.doSAMLCallback(callbackHandler, samlCallback);
SamlAssertionWrapper samlAssertion = new SamlAssertionWrapper(samlCallback);
Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
WSSecHeader secHeader = new WSSecHeader();
secHeader.insertSecurityHeader(doc);
SecurityTokenReference secRefSaml =
createSamlSTR(doc, samlAssertion, WSSConfig.getNewInstance());
Element samlTokenElement = samlAssertion.toDOM(doc);
Element secRefElement = secRefSaml.getElement();
secHeader.getSecurityHeader().appendChild(samlTokenElement);
secHeader.getSecurityHeader().appendChild(secRefElement);
//
// Create a Derived Key object for signature
//
WSSecDKSign sigBuilder = createDKSign(doc, secRefSaml);