Element samlToken =
createSAMLAssertion(WSConstants.WSS_SAML2_TOKEN_TYPE, crypto, "mystskey",
callbackHandler, null, STSConstants.SYMMETRIC_KEY_TYPE);
Document doc = samlToken.getOwnerDocument();
samlToken = (Element)doc.appendChild(samlToken);
OnBehalfOfType onbehalfof = new OnBehalfOfType();
onbehalfof.setAny(samlToken);
JAXBElement<OnBehalfOfType> onbehalfofType =
new JAXBElement<OnBehalfOfType>(
QNameConstants.ON_BEHALF_OF, OnBehalfOfType.class, onbehalfof
);