knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject [17/49] knox git commit: KNOX-1134 - Regression due to KNOX-1119
Date Thu, 14 Dec 2017 21:13:04 GMT
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/27217ead
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/27217ead
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/27217ead

Branch: refs/heads/KNOX-998-Package_Restructuring
Commit: 27217ead9a67bcded8978133a9d7abe40ebc1d1a
Parents: d835af9
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:40:07 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/27217ead/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