cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1339585 - in /cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso: AbstractSSOSpHandler.java AbstractServiceProviderFilter.java
Date Thu, 17 May 2012 13:02:56 GMT
Author: sergeyb
Date: Thu May 17 13:02:56 2012
New Revision: 1339585

URL: http://svn.apache.org/viewvc?rev=1339585&view=rev
Log:
Minor updates to the filter code

Modified:
    cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractSSOSpHandler.java
    cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java

Modified: cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractSSOSpHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractSSOSpHandler.java?rev=1339585&r1=1339584&r2=1339585&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractSSOSpHandler.java
(original)
+++ cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractSSOSpHandler.java
Thu May 17 13:02:56 2012
@@ -20,13 +20,10 @@ package org.apache.cxf.rs.security.saml.
 
 import java.util.Date;
 
-import javax.ws.rs.Path;
-
 import org.apache.cxf.jaxrs.utils.HttpUtils;
 import org.apache.cxf.rs.security.saml.sso.state.SPStateManager;
 import org.apache.ws.security.saml.ext.OpenSAMLUtil;
 
-@Path("sso")
 public class AbstractSSOSpHandler {
     private SPStateManager stateProvider;
     private long stateTimeToLive = SSOConstants.DEFAULT_STATE_TIME;

Modified: cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java?rev=1339585&r1=1339584&r2=1339585&view=diff
==============================================================================
--- cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java
(original)
+++ cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java
Thu May 17 13:02:56 2012
@@ -24,6 +24,7 @@ import java.net.URLEncoder;
 import java.util.Map;
 import java.util.ResourceBundle;
 import java.util.UUID;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.ws.rs.WebApplicationException;
@@ -47,7 +48,6 @@ import org.apache.cxf.rs.security.saml.s
 import org.apache.cxf.rs.security.saml.sso.state.ResponseState;
 import org.apache.ws.security.saml.ext.OpenSAMLUtil;
 import org.apache.ws.security.util.DOM2Writer;
-
 import org.opensaml.saml2.core.AuthnRequest;
 
 public abstract class AbstractServiceProviderFilter extends AbstractSSOSpHandler 
@@ -99,7 +99,11 @@ public abstract class AbstractServicePro
         
         Cookie securityContextCookie = cookies.get(SSOConstants.SECURITY_CONTEXT_TOKEN);
         if (securityContextCookie == null) {
-            reportError("MISSING_RESPONSE_STATE");
+            // most likely it means that the user has not been offered
+            // a chance to get logged on yet, though it might be that the browser
+            // has removed an expired cookie from its cache; warning is too noisy in the
+            // former case
+            reportTrace("MISSING_RESPONSE_STATE");
             return false;
         }
         String contextKey = securityContextCookie.getValue();
@@ -156,7 +160,7 @@ public abstract class AbstractServicePro
         
         String httpBasePath = (String)m.get("http.base.path");
         String webAppContext = URI.create(httpBasePath).getRawPath();
-        String originalRequestURI = (String)m.get(Message.REQUEST_URI);
+        String originalRequestURI = new UriInfoImpl(m).getRequestUri().toString();
         
         RequestState requestState = new RequestState(originalRequestURI,
                                                      getIdpServiceAddress(),
@@ -198,6 +202,14 @@ public abstract class AbstractServicePro
             new org.apache.cxf.common.i18n.Message(code, BUNDLE);
         LOG.warning(errorMsg.toString());
     }
+    
+    protected void reportTrace(String code) {
+        if (LOG.isLoggable(Level.FINE)) {
+            org.apache.cxf.common.i18n.Message errorMsg = 
+                new org.apache.cxf.common.i18n.Message(code, BUNDLE);
+            LOG.fine(errorMsg.toString());
+        }
+    }
 
     public String getWebAppDomain() {
         return webAppDomain;



Mime
View raw message