Fixing test
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/b6b7a419 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b6b7a419 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b6b7a419 Branch: refs/heads/2.7.x-fixes Commit: b6b7a419ab42e2fd006f3868773a6d3cdb3a0041 Parents: 2640b69 Author: Colm O hEigeartaigh <[email protected]> Authored: Wed Jan 14 16:58:16 2015 +0000 Committer: Colm O hEigeartaigh <[email protected]> Committed: Wed Jan 14 16:58:16 2015 +0000 ---------------------------------------------------------------------- parent/pom.xml | 2 +- .../saml/sso/SAMLProtocolResponseValidator.java | 15 ++------------- .../security/saml/sso/SAMLResponseValidatorTest.java | 12 ++++++------ 3 files changed, 9 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/b6b7a419/parent/pom.xml ---------------------------------------------------------------------- diff --git a/parent/pom.xml b/parent/pom.xml index 99c507e..0e6187f 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -158,7 +158,7 @@ <cxf.woodstox.core.version>4.4.1</cxf.woodstox.core.version> <cxf.woodstox.stax2-api.version>3.1.4</cxf.woodstox.stax2-api.version> <cxf.wsdl4j.version>1.6.3</cxf.wsdl4j.version> - <cxf.wss4j.version>1.6.17</cxf.wss4j.version> + <cxf.wss4j.version>1.6.18-SNAPSHOT</cxf.wss4j.version> <cxf.xerces.version>2.11.0</cxf.xerces.version> <cxf.xmlbeans.version>2.6.0</cxf.xmlbeans.version> <cxf.xmlschema.version>2.1.0</cxf.xmlschema.version> http://git-wip-us.apache.org/repos/asf/cxf/blob/b6b7a419/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLProtocolResponseValidator.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLProtocolResponseValidator.java b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLProtocolResponseValidator.java index e02cb38..d6bfee6 100644 --- a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLProtocolResponseValidator.java +++ b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLProtocolResponseValidator.java @@ -80,16 +80,12 @@ public class SAMLProtocolResponseValidator { private Validator assertionValidator = new SamlAssertionValidator(); private Validator signatureValidator = new SignatureTrustValidator(); -<<<<<<< HEAD -======= - private boolean keyInfoMustBeAvailable = true; /** * The time in seconds in the future within which the NotBefore time of an incoming * Assertion is valid. The default is 60 seconds. */ private int futureTTL = 60; ->>>>>>> ce2c2f3... Adding some more SAML SSO tests /** * Validate a SAML 2 Protocol Response @@ -122,7 +118,7 @@ public class SAMLProtocolResponseValidator { currentTime = currentTime.plusSeconds(futureTTL); if (samlResponse.getIssueInstant().isAfter(currentTime)) { LOG.fine("SAML Response IssueInstant not met"); - throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity"); + throw new WSSecurityException(WSSecurityException.FAILURE, "invalidSAMLsecurity"); } } @@ -179,7 +175,7 @@ public class SAMLProtocolResponseValidator { currentTime = currentTime.plusSeconds(futureTTL); if (samlResponse.getIssueInstant().isAfter(currentTime)) { LOG.fine("SAML Response IssueInstant not met"); - throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity"); + throw new WSSecurityException(WSSecurityException.FAILURE, "invalidSAMLsecurity"); } } @@ -539,12 +535,6 @@ public class SAMLProtocolResponseValidator { } } -<<<<<<< HEAD -======= - public void setKeyInfoMustBeAvailable(boolean keyInfoMustBeAvailable) { - this.keyInfoMustBeAvailable = keyInfoMustBeAvailable; - } - public int getFutureTTL() { return futureTTL; } @@ -553,5 +543,4 @@ public class SAMLProtocolResponseValidator { this.futureTTL = futureTTL; } ->>>>>>> ce2c2f3... Adding some more SAML SSO tests } http://git-wip-us.apache.org/repos/asf/cxf/blob/b6b7a419/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/SAMLResponseValidatorTest.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/SAMLResponseValidatorTest.java b/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/SAMLResponseValidatorTest.java index 334cbf5..56f910a 100644 --- a/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/SAMLResponseValidatorTest.java +++ b/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/SAMLResponseValidatorTest.java @@ -585,9 +585,9 @@ public class SAMLResponseValidatorTest extends org.junit.Assert { callbackHandler.setIssuer("http://cxf.apache.org/issuer"); callbackHandler.setConfirmationMethod(SAML2Constants.CONF_SENDER_VOUCHES); - SAMLCallback samlCallback = new SAMLCallback(); - SAMLUtil.doSAMLCallback(callbackHandler, samlCallback); - SamlAssertionWrapper assertion = new SamlAssertionWrapper(samlCallback); + SAMLParms samlParms = new SAMLParms(); + samlParms.setCallbackHandler(callbackHandler); + AssertionWrapper assertion = new AssertionWrapper(samlParms); response.getAssertions().add(assertion.getSaml2()); @@ -629,9 +629,9 @@ public class SAMLResponseValidatorTest extends org.junit.Assert { callbackHandler.setIssuer("http://cxf.apache.org/issuer"); callbackHandler.setConfirmationMethod(SAML2Constants.CONF_SENDER_VOUCHES); - SAMLCallback samlCallback = new SAMLCallback(); - SAMLUtil.doSAMLCallback(callbackHandler, samlCallback); - SamlAssertionWrapper assertion = new SamlAssertionWrapper(samlCallback); + SAMLParms samlParms = new SAMLParms(); + samlParms.setCallbackHandler(callbackHandler); + AssertionWrapper assertion = new AssertionWrapper(samlParms); assertion.getSaml2().setIssueInstant(new DateTime().plusMinutes(5));
