cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject git commit: More work on CXF plugin
Date Fri, 01 Aug 2014 14:40:54 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master e17038b53 -> 040ed9a50


More work on CXF plugin


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

Branch: refs/heads/master
Commit: 040ed9a50f89cb7592d8bda520bdfdacb262addd
Parents: e17038b
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Fri Aug 1 15:40:39 2014 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Fri Aug 1 15:40:39 2014 +0100

----------------------------------------------------------------------
 .../cxf/plugin/AbstractServiceProviderFilter.java      | 13 +++++--------
 .../fediz/cxf/plugin/SamlRedirectBindingFilter.java    | 11 +++++------
 2 files changed, 10 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/040ed9a5/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/AbstractServiceProviderFilter.java
----------------------------------------------------------------------
diff --git a/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/AbstractServiceProviderFilter.java
b/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/AbstractServiceProviderFilter.java
index b37a4d1..7177886 100644
--- a/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/AbstractServiceProviderFilter.java
+++ b/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/AbstractServiceProviderFilter.java
@@ -200,12 +200,12 @@ public abstract class AbstractServiceProviderFilter implements ContainerRequestF
             return null;
         }
         
-        // TODO String webAppContext = getWebAppContext(m);
+        String webAppContext = getWebAppContext(m);
         if (webAppDomain != null 
             && (responseState.getWebAppDomain() == null 
-                || !webAppDomain.equals(responseState.getWebAppDomain()))) {
-            // TODO || responseState.getWebAppContext() == null
-            // TODO || !webAppContext.equals(responseState.getWebAppContext())) {
+                || !webAppDomain.equals(responseState.getWebAppDomain()))
+                || responseState.getWebAppContext() == null
+                || !webAppContext.equals(responseState.getWebAppContext())) {
             protocol.getStateManager().removeResponseState(contextKey);
             reportError("INVALID_RESPONSE_STATE");
             return null;
@@ -218,10 +218,7 @@ public abstract class AbstractServiceProviderFilter implements ContainerRequestF
     }
     
     protected FedizContext getFedizContext(Message message) {
-        String contextName = new UriInfoImpl(message).getRequestUri().getPath();
-        if (contextName == null || contextName.isEmpty()) {
-            contextName = "/";
-        }
+        String contextName = getWebAppContext(message);
         String[] contextPath = contextName.split("/");
         if (contextPath.length > 0) {
             contextName = "/" + contextPath[1];

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/040ed9a5/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/SamlRedirectBindingFilter.java
----------------------------------------------------------------------
diff --git a/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/SamlRedirectBindingFilter.java
b/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/SamlRedirectBindingFilter.java
index a31e0e2..64e1d71 100644
--- a/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/SamlRedirectBindingFilter.java
+++ b/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/SamlRedirectBindingFilter.java
@@ -65,9 +65,6 @@ public class SamlRedirectBindingFilter extends AbstractServiceProviderFilter
{
     public void filter(ContainerRequestContext context) {
         Message m = JAXRSUtils.getCurrentMessage();
         
-        String webAppContext = getWebAppContext(m);
-        System.out.println("WEB APP CTX: " + webAppContext);
-        
         if (checkSecurityContext(m)) {
             return;
         } else {
@@ -143,7 +140,7 @@ public class SamlRedirectBindingFilter extends AbstractServiceProviderFilter
{
                         SAMLProtocol protocol = (SAMLProtocol)fedConfig.getProtocol();
                         
                         long currentTime = System.currentTimeMillis();
-                        Date notOnOrAfter =  wfRes.getTokenExpires();
+                        Date notOnOrAfter = wfRes.getTokenExpires();
                         long expiresAt = 0;
                         if (notOnOrAfter != null) {
                             expiresAt = notOnOrAfter.getTime();
@@ -158,10 +155,12 @@ public class SamlRedirectBindingFilter extends AbstractServiceProviderFilter
{
                             roles = Collections.singletonList("Authenticated");
                         }
                         
+                        String webAppContext = getWebAppContext(m);
+                        
                         ResponseState responseState = 
                             new ResponseState(token,
                                               params.getFirst("RelayState"), 
-                                              null, // TODO
+                                              webAppContext,
                                               webAppDomain,
                                               currentTime, 
                                               expiresAt);
@@ -174,7 +173,7 @@ public class SamlRedirectBindingFilter extends AbstractServiceProviderFilter
{
                         long stateTimeToLive = protocol.getStateTimeToLive();
                         String contextCookie = CookieUtils.createCookie(SECURITY_CONTEXT_TOKEN,
                                                             securityContextKey,
-                                                            null, // TODO
+                                                            webAppContext,
                                                             webAppDomain,
                                                             stateTimeToLive);
                         


Mime
View raw message