knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject knox git commit: KNOX-1134 - Regression due to KNOX-1119
Date Fri, 01 Dec 2017 12:41:13 GMT
Repository: knox
Updated Branches:
  refs/heads/v0.14.0 83186a5c6 -> 9610c50c4


KNOX-1134 - Regression due to KNOX-1119


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

Branch: refs/heads/v0.14.0
Commit: 9610c50c43e048bf53cb05406360ed1060b01ba7
Parents: 83186a5
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Fri Dec 1 12:40:07 2017 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Fri Dec 1 12:41:10 2017 +0000

----------------------------------------------------------------------
 .../hadoop/gateway/pac4j/filter/Pac4jIdentityAdapter.java     | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/9610c50c/gateway-provider-security-pac4j/src/main/java/org/apache/hadoop/gateway/pac4j/filter/Pac4jIdentityAdapter.java
----------------------------------------------------------------------
diff --git a/gateway-provider-security-pac4j/src/main/java/org/apache/hadoop/gateway/pac4j/filter/Pac4jIdentityAdapter.java
b/gateway-provider-security-pac4j/src/main/java/org/apache/hadoop/gateway/pac4j/filter/Pac4jIdentityAdapter.java
index 1ec0491..20084b1 100644
--- a/gateway-provider-security-pac4j/src/main/java/org/apache/hadoop/gateway/pac4j/filter/Pac4jIdentityAdapter.java
+++ b/gateway-provider-security-pac4j/src/main/java/org/apache/hadoop/gateway/pac4j/filter/Pac4jIdentityAdapter.java
@@ -78,8 +78,11 @@ public class Pac4jIdentityAdapter implements Filter {
       logger.debug("User authenticated as: {}", profile);
       manager.remove(true);
       String id = null;
-      if (idAttribute == null) {
-        id = profile.getAttribute(idAttribute).toString();
+      if (idAttribute != null) {
+        Object attribute = profile.getAttribute(idAttribute);
+        if (attribute != null) {
+          id = attribute.toString();
+        }
         if (id == null) {
           logger.error("Invalid attribute_id: {} configured to be used as principal"
               + " falling back to default id", idAttribute);


Mime
View raw message