cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1397595 - /cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/authorization/SecurityContextProviderImpl.java
Date Fri, 12 Oct 2012 14:54:37 GMT
Author: coheigea
Date: Fri Oct 12 14:54:37 2012
New Revision: 1397595

URL: http://svn.apache.org/viewvc?rev=1397595&view=rev
Log:
Store the SAML Assertion in the (JAX-RS) SecurityContext

Modified:
    cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/authorization/SecurityContextProviderImpl.java

Modified: cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/authorization/SecurityContextProviderImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/authorization/SecurityContextProviderImpl.java?rev=1397595&r1=1397594&r2=1397595&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/authorization/SecurityContextProviderImpl.java
(original)
+++ cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/authorization/SecurityContextProviderImpl.java
Fri Oct 12 14:54:37 2012
@@ -18,6 +18,9 @@
  */
 package org.apache.cxf.rs.security.saml.authorization;
 
+import org.w3c.dom.Element;
+
+import org.apache.cxf.interceptor.security.SAMLSecurityContext;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.rs.security.saml.SAMLUtils;
 import org.apache.cxf.rs.security.saml.assertion.Claim;
@@ -35,7 +38,12 @@ public class SecurityContextProviderImpl
             AssertionWrapper wrapper) {
         Claims claims = getClaims(wrapper);
         Subject subject = getSubject(message, wrapper, claims);
-        return doGetSecurityContext(message, subject, claims);
+        SecurityContext securityContext = doGetSecurityContext(message, subject, claims);
+        if (securityContext instanceof SAMLSecurityContext) {
+            Element assertionElement = wrapper.getElement();
+            ((SAMLSecurityContext)securityContext).setAssertionElement(assertionElement);
+        }
+        return securityContext;
     }
 
     protected Claims getClaims(AssertionWrapper wrapper) {



Mime
View raw message