You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2017/08/04 07:37:06 UTC

[2/2] syncope git commit: [SYNCOPE-1185] Ensuring that the correct SAMLSSOResponseValidator is taken into account

[SYNCOPE-1185] Ensuring that the correct SAMLSSOResponseValidator is taken into account


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/7e5d38b7
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/7e5d38b7
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/7e5d38b7

Branch: refs/heads/master
Commit: 7e5d38b7165fba5763d1c8fda2033f74f3814b13
Parents: 2a76703
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Fri Aug 4 09:36:56 2017 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Fri Aug 4 09:36:56 2017 +0200

----------------------------------------------------------------------
 .../syncope/core/logic/saml2/SAML2ReaderWriter.java     | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/7e5d38b7/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/saml2/SAML2ReaderWriter.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/saml2/SAML2ReaderWriter.java b/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/saml2/SAML2ReaderWriter.java
index 3431a86..096dccb 100644
--- a/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/saml2/SAML2ReaderWriter.java
+++ b/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/saml2/SAML2ReaderWriter.java
@@ -90,10 +90,6 @@ public class SAML2ReaderWriter {
 
     private String jceSigAlgo;
 
-    private SAMLProtocolResponseValidator protocolValidator;
-
-    private SAMLSSOResponseValidator ssoResponseValidator;
-
     private SAMLSPCallbackHandler callbackHandler;
 
     public void init() {
@@ -109,11 +105,6 @@ public class SAML2ReaderWriter {
             jceSigAlgo = "SHA1withDSA";
         }
 
-        protocolValidator = new SAMLProtocolResponseValidator();
-        protocolValidator.setKeyInfoMustBeAvailable(true);
-
-        ssoResponseValidator = new SAMLSSOResponseValidator();
-
         callbackHandler = new SAMLSPCallbackHandler(loader.getKeyPass());
     }
 
@@ -223,8 +214,11 @@ public class SAML2ReaderWriter {
         crypto.setKeyStore(loader.getKeyStore());
         crypto.setTrustStore(idp.getTrustStore());
 
+        SAMLProtocolResponseValidator protocolValidator = new SAMLProtocolResponseValidator();
+        protocolValidator.setKeyInfoMustBeAvailable(true);
         protocolValidator.validateSamlResponse(samlResponse, crypto, callbackHandler);
 
+        SAMLSSOResponseValidator ssoResponseValidator = new SAMLSSOResponseValidator();
         ssoResponseValidator.setAssertionConsumerURL(assertionConsumerURL);
         ssoResponseValidator.setIssuerIDP(idp.getId());
         ssoResponseValidator.setRequestId(requestId);