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-730 - pac4jRequestedUrl = null after saml2 assertion is parsed
Date Sun, 19 Feb 2017 20:20:43 GMT
Repository: knox
Updated Branches:
  refs/heads/master d187a877c -> 9af4fe401


KNOX-730 - pac4jRequestedUrl = null after saml2 assertion is parsed

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

Branch: refs/heads/master
Commit: 9af4fe40178cf69778421e8c8f8af81c9b157574
Parents: d187a87
Author: Larry McCay <lmccay@hortonworks.com>
Authored: Sun Feb 19 15:20:19 2017 -0500
Committer: Larry McCay <lmccay@hortonworks.com>
Committed: Sun Feb 19 15:20:19 2017 -0500

----------------------------------------------------------------------
 .../hadoop/gateway/pac4j/filter/Pac4jDispatcherFilter.java     | 2 +-
 .../src/main/java/org/apache/hadoop/gateway/util/Urls.java     | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/9af4fe40/gateway-provider-security-pac4j/src/main/java/org/apache/hadoop/gateway/pac4j/filter/Pac4jDispatcherFilter.java
----------------------------------------------------------------------
diff --git a/gateway-provider-security-pac4j/src/main/java/org/apache/hadoop/gateway/pac4j/filter/Pac4jDispatcherFilter.java
b/gateway-provider-security-pac4j/src/main/java/org/apache/hadoop/gateway/pac4j/filter/Pac4jDispatcherFilter.java
index 79955a0..574dea5 100644
--- a/gateway-provider-security-pac4j/src/main/java/org/apache/hadoop/gateway/pac4j/filter/Pac4jDispatcherFilter.java
+++ b/gateway-provider-security-pac4j/src/main/java/org/apache/hadoop/gateway/pac4j/filter/Pac4jDispatcherFilter.java
@@ -158,7 +158,7 @@ public class Pac4jDispatcherFilter implements Filter {
     requiresAuthenticationFilter.setClientName(clientName);
     requiresAuthenticationFilter.setConfig(config);
 
-    final String domainSuffix = context.getInitParameter(PAC4J_COOKIE_DOMAIN_SUFFIX_PARAM);
+    final String domainSuffix = filterConfig.getInitParameter(PAC4J_COOKIE_DOMAIN_SUFFIX_PARAM);
     config.setSessionStore(new KnoxSessionStore(cryptoService, clusterName, domainSuffix));
     ConfigSingleton.setConfig(config);
   }

http://git-wip-us.apache.org/repos/asf/knox/blob/9af4fe40/gateway-util-common/src/main/java/org/apache/hadoop/gateway/util/Urls.java
----------------------------------------------------------------------
diff --git a/gateway-util-common/src/main/java/org/apache/hadoop/gateway/util/Urls.java b/gateway-util-common/src/main/java/org/apache/hadoop/gateway/util/Urls.java
index cae9c11..1387693 100644
--- a/gateway-util-common/src/main/java/org/apache/hadoop/gateway/util/Urls.java
+++ b/gateway-util-common/src/main/java/org/apache/hadoop/gateway/util/Urls.java
@@ -88,6 +88,12 @@ public class Urls {
     final URL originalUrl = new URL(url);
     final String domain = originalUrl.getHost();
 
+    // if the configured domainSuffix is '*' assume that it should be
+    // the default domain which should be the FQHN
+    if ("*".equals(domainSuffix)) {
+      return domain;
+    }
+
     // if the hostname ends with the domainSuffix the use the domainSuffix as
     // the cookie domain
     if (domainSuffix != null && domain.endsWith(domainSuffix)) {


Mime
View raw message