cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf git commit: Make some information from the SAML SSO validation process available in an easier way
Date Thu, 27 Nov 2014 14:52:22 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 1bfbb320f -> 2e0c207de


Make some information from the SAML SSO validation process available in an easier way


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/2e0c207d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2e0c207d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2e0c207d

Branch: refs/heads/master
Commit: 2e0c207deffafb938318eb4a1b1450f79aa3916f
Parents: 1bfbb32
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Thu Nov 27 14:52:01 2014 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Thu Nov 27 14:52:01 2014 +0000

----------------------------------------------------------------------
 .../saml/sso/SAMLSSOResponseValidator.java      |  9 ++++++++-
 .../security/saml/sso/SSOValidatorResponse.java | 20 ++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/2e0c207d/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLSSOResponseValidator.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLSSOResponseValidator.java
b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLSSOResponseValidator.java
index 1a735b90..b8a764c 100644
--- a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLSSOResponseValidator.java
+++ b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLSSOResponseValidator.java
@@ -135,9 +135,16 @@ public class SAMLSSOResponseValidator {
         SSOValidatorResponse validatorResponse = new SSOValidatorResponse();
         validatorResponse.setResponseId(samlResponse.getID());
         validatorResponse.setSessionNotOnOrAfter(sessionNotOnOrAfter);
+        if (samlResponse.getIssueInstant() != null) {
+            validatorResponse.setCreated(samlResponse.getIssueInstant().toDate());
+        }
+        
         // the assumption for now is that SAMLResponse will contain only a single assertion
         Element assertionElement = samlResponse.getAssertions().get(0).getDOM();
-        validatorResponse.setAssertion(DOM2Writer.nodeToString(assertionElement.cloneNode(true)));
+        Element clonedAssertionElement = (Element)assertionElement.cloneNode(true);
+        validatorResponse.setAssertionElement(clonedAssertionElement);
+        validatorResponse.setAssertion(DOM2Writer.nodeToString(clonedAssertionElement));
+        
         return validatorResponse;
     }
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/2e0c207d/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SSOValidatorResponse.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SSOValidatorResponse.java
b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SSOValidatorResponse.java
index 51a5aad..1a82357 100644
--- a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SSOValidatorResponse.java
+++ b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SSOValidatorResponse.java
@@ -20,13 +20,17 @@ package org.apache.cxf.rs.security.saml.sso;
 
 import java.util.Date;
 
+import org.w3c.dom.Element;
+
 /**
  * Some information that encapsulates a successful validation by the SAMLSSOResponseValidator
  */
 public class SSOValidatorResponse {
     private Date sessionNotOnOrAfter;
+    private Date created;
     private String responseId;
     private String assertion;
+    private Element assertionElement;
 
     public String getAssertion() {
         return assertion;
@@ -51,4 +55,20 @@ public class SSOValidatorResponse {
     public void setResponseId(String responseId) {
         this.responseId = responseId;
     }
+
+    public Element getAssertionElement() {
+        return assertionElement;
+    }
+
+    public void setAssertionElement(Element assertionElement) {
+        this.assertionElement = assertionElement;
+    }
+
+    public Date getCreated() {
+        return created;
+    }
+
+    public void setCreated(Date created) {
+        this.created = created;
+    }
 }


Mime
View raw message