use of org.apache.wss4j.dom.processor.SAMLTokenProcessor in project ddf by codice.
the class StsIssueTest method processToken.
/**
* Method to validate the retrieved token.
*/
private List<WSSecurityEngineResult> processToken(SecurityToken token) throws WSSecurityException {
RequestData requestData = new RequestData();
WSSConfig wssConfig = WSSConfig.getNewInstance();
requestData.setWssConfig(wssConfig);
/*DDF-733
CallbackHandler callbackHandler = new CommonCallbackHandler();
requestData.setCallbackHandler(callbackHandler);
*/
Crypto crypto = CryptoFactory.getInstance("serverKeystore.properties");
requestData.setDecCrypto(crypto);
requestData.setSigVerCrypto(crypto);
Processor processor = new SAMLTokenProcessor();
return processor.handleToken(token.getToken(), requestData, new WSDocInfo(token.getToken().getOwnerDocument()));
}
use of org.apache.wss4j.dom.processor.SAMLTokenProcessor in project cxf by apache.
the class IssueUnitTest method processToken.
private List<WSSecurityEngineResult> processToken(SecurityToken token) throws Exception {
RequestData requestData = new RequestData();
requestData.setDisableBSPEnforcement(true);
CallbackHandler callbackHandler = new org.apache.cxf.systest.sts.common.CommonCallbackHandler();
requestData.setCallbackHandler(callbackHandler);
Crypto crypto = CryptoFactory.getInstance("serviceKeystore.properties");
requestData.setDecCrypto(crypto);
requestData.setSigVerCrypto(crypto);
requestData.setWsDocInfo(new WSDocInfo(token.getToken().getOwnerDocument()));
Processor processor = new SAMLTokenProcessor();
return processor.handleToken(token.getToken(), requestData);
}
use of org.apache.wss4j.dom.processor.SAMLTokenProcessor in project cxf by apache.
the class STSRESTTest method processToken.
private static List<WSSecurityEngineResult> processToken(Element assertionElement) throws Exception {
RequestData requestData = new RequestData();
// requestData.setDisableBSPEnforcement(true);
requestData.setCallbackHandler(new org.apache.cxf.systest.sts.common.CommonCallbackHandler());
requestData.setDecCrypto(serviceCrypto);
// requestData.setSigVerCrypto(serviceCrypto);
requestData.setWsDocInfo(new WSDocInfo(assertionElement.getOwnerDocument()));
return new SAMLTokenProcessor().handleToken(assertionElement, requestData);
}
use of org.apache.wss4j.dom.processor.SAMLTokenProcessor in project cxf by apache.
the class SamlTokenInterceptor method processToken.
private List<WSSecurityEngineResult> processToken(Element tokenElement, final SoapMessage message) throws WSSecurityException {
RequestData data = new CXFRequestData();
Object o = SecurityUtils.getSecurityPropertyValue(SecurityConstants.CALLBACK_HANDLER, message);
try {
data.setCallbackHandler(SecurityUtils.getCallbackHandler(o));
} catch (Exception ex) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex);
}
data.setMsgContext(message);
data.setWssConfig(WSSConfig.getNewInstance());
data.setSigVerCrypto(getCrypto(SecurityConstants.SIGNATURE_CRYPTO, SecurityConstants.SIGNATURE_PROPERTIES, message));
WSDocInfo wsDocInfo = new WSDocInfo(tokenElement.getOwnerDocument());
data.setWsDocInfo(wsDocInfo);
SAMLTokenProcessor p = new SAMLTokenProcessor();
return p.handleToken(tokenElement, data);
}
use of org.apache.wss4j.dom.processor.SAMLTokenProcessor in project cxf by apache.
the class STSUnitTest method processToken.
private List<WSSecurityEngineResult> processToken(SecurityToken token) throws Exception {
RequestData requestData = new RequestData();
CallbackHandler callbackHandler = new CommonCallbackHandler();
requestData.setCallbackHandler(callbackHandler);
Crypto crypto = CryptoFactory.getInstance("clientKeystore.properties", this.getClass().getClassLoader());
requestData.setSigVerCrypto(crypto);
requestData.setWsDocInfo(new WSDocInfo(token.getToken().getOwnerDocument()));
Processor processor = new SAMLTokenProcessor();
return processor.handleToken(token.getToken(), requestData);
}
Aggregations