You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2013/12/16 16:25:35 UTC
svn commit: r1551231 -
/cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
Author: coheigea
Date: Mon Dec 16 15:25:35 2013
New Revision: 1551231
URL: http://svn.apache.org/r1551231
Log:
Fixing build
Modified:
cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
Modified: cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java?rev=1551231&r1=1551230&r2=1551231&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java (original)
+++ cxf/branches/2.7.x-fixes/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java Mon Dec 16 15:25:35 2013
@@ -152,24 +152,18 @@ public class SAMLTokenValidator implemen
LOG.log(Level.WARNING, "The received assertion is not signed, and therefore not trusted");
return response;
}
-
+
RequestData requestData = new RequestData();
- requestData.setSigVerCrypto(sigCrypto);
+ requestData.setSigCrypto(sigCrypto);
WSSConfig wssConfig = WSSConfig.getNewInstance();
requestData.setWssConfig(wssConfig);
requestData.setCallbackHandler(callbackHandler);
requestData.setMsgContext(tokenParameters.getWebServiceContext().getMessageContext());
- WSDocInfo docInfo = new WSDocInfo(validateTargetElement.getOwnerDocument());
-
// Verify the signature
- Signature sig = assertion.getSignature();
- KeyInfo keyInfo = sig.getKeyInfo();
- SAMLKeyInfo samlKeyInfo =
- SAMLUtil.getCredentialFromKeyInfo(
- keyInfo.getDOM(), new WSSSAMLKeyInfoProcessor(requestData, docInfo), sigCrypto
- );
- assertion.verifySignature(samlKeyInfo);
+ assertion.verifySignature(
+ requestData, new WSDocInfo(validateTargetElement.getOwnerDocument())
+ );
SecurityToken secToken = null;
byte[] signatureValue = assertion.getSignatureValue();
@@ -187,26 +181,6 @@ public class SAMLTokenValidator implemen
}
if (secToken == null) {
-<<<<<<< HEAD
- if (!assertion.isSigned()) {
- LOG.log(Level.WARNING, "The received assertion is not signed, and therefore not trusted");
- return response;
- }
-
- RequestData requestData = new RequestData();
- requestData.setSigCrypto(sigCrypto);
- WSSConfig wssConfig = WSSConfig.getNewInstance();
- requestData.setWssConfig(wssConfig);
- requestData.setCallbackHandler(callbackHandler);
- requestData.setMsgContext(tokenParameters.getWebServiceContext().getMessageContext());
-
- // Verify the signature
- assertion.verifySignature(
- requestData, new WSDocInfo(validateTargetElement.getOwnerDocument())
- );
-
-=======
->>>>>>> 4b3dbb3... Validation fix in the STS
// Validate the assertion against schemas/profiles
validateAssertion(assertion);