knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lmc...@apache.org
Subject knox git commit: KNOX-607 - Fix SSOCookieProvider to Handle null Query Strings
Date Thu, 15 Oct 2015 17:49:57 GMT
Repository: knox
Updated Branches:
  refs/heads/master 055c9df52 -> 42f8ec75e


KNOX-607 - Fix SSOCookieProvider to Handle null Query Strings

Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/42f8ec75
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/42f8ec75
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/42f8ec75

Branch: refs/heads/master
Commit: 42f8ec75e4810d2629f1be8258908c50fa627b58
Parents: 055c9df
Author: Larry McCay <lmccay@hortonworks.com>
Authored: Thu Oct 15 13:37:38 2015 -0400
Committer: Larry McCay <lmccay@hortonworks.com>
Committed: Thu Oct 15 13:37:38 2015 -0400

----------------------------------------------------------------------
 .../federation/jwt/filter/SSOCookieFederationFilter.java      | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/42f8ec75/gateway-provider-security-jwt/src/main/java/org/apache/hadoop/gateway/provider/federation/jwt/filter/SSOCookieFederationFilter.java
----------------------------------------------------------------------
diff --git a/gateway-provider-security-jwt/src/main/java/org/apache/hadoop/gateway/provider/federation/jwt/filter/SSOCookieFederationFilter.java
b/gateway-provider-security-jwt/src/main/java/org/apache/hadoop/gateway/provider/federation/jwt/filter/SSOCookieFederationFilter.java
index 4a17654..b36c7a3 100644
--- a/gateway-provider-security-jwt/src/main/java/org/apache/hadoop/gateway/provider/federation/jwt/filter/SSOCookieFederationFilter.java
+++ b/gateway-provider-security-jwt/src/main/java/org/apache/hadoop/gateway/provider/federation/jwt/filter/SSOCookieFederationFilter.java
@@ -192,10 +192,15 @@ public class SSOCookieFederationFilter implements Filter {
     }
     String loginURL = authenticationProviderUrl + delimiter
         + ORIGINAL_URL_QUERY_PARAM
-        + request.getRequestURL().toString() + "?" + request.getQueryString();
+        + request.getRequestURL().toString() + getOriginalQueryString(request);
     return loginURL;
   }
 
+  private String getOriginalQueryString(HttpServletRequest request) {
+    String originalQueryString = request.getQueryString();
+    return (originalQueryString == null) ? "" : "?" + originalQueryString;
+  }
+
   /**
    * Validate whether any of the accepted audience claims is present in the
    * issued token claims list for audience. Override this method in subclasses


Mime
View raw message