You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by pe...@apache.org on 2018/02/11 16:22:59 UTC

kylin git commit: KYLIN-3197 When ldap is opened, I use an ignored case user to login, the page does not respond.

Repository: kylin
Updated Branches:
  refs/heads/master 3fa11b2cf -> 2fd676b36


KYLIN-3197 When ldap is opened, I use an ignored case user to login, the page does not respond.

Signed-off-by: peng.jianhua <pe...@zte.com.cn>


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/2fd676b3
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/2fd676b3
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/2fd676b3

Branch: refs/heads/master
Commit: 2fd676b36ec9e0f853d59db31ee62cd90a647641
Parents: 3fa11b2
Author: xingpeng1 <xi...@zte.com.cn>
Authored: Thu Jan 25 17:31:03 2018 +0800
Committer: peng.jianhua <pe...@zte.com.cn>
Committed: Mon Feb 12 00:22:50 2018 +0800

----------------------------------------------------------------------
 .../apache/kylin/rest/security/LDAPAuthoritiesPopulator.java | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/2fd676b3/server-base/src/main/java/org/apache/kylin/rest/security/LDAPAuthoritiesPopulator.java
----------------------------------------------------------------------
diff --git a/server-base/src/main/java/org/apache/kylin/rest/security/LDAPAuthoritiesPopulator.java b/server-base/src/main/java/org/apache/kylin/rest/security/LDAPAuthoritiesPopulator.java
index f5a49e0..50e3cf3 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/security/LDAPAuthoritiesPopulator.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/security/LDAPAuthoritiesPopulator.java
@@ -22,6 +22,7 @@ import java.util.Set;
 
 import org.apache.kylin.rest.constant.Constant;
 import org.springframework.ldap.core.ContextSource;
+import org.springframework.ldap.core.DirContextOperations;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.authority.SimpleGrantedAuthority;
 import org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator;
@@ -48,4 +49,11 @@ public class LDAPAuthoritiesPopulator extends DefaultLdapAuthoritiesPopulator {
         }
         return userAuthorities;
     }
+
+    @Override
+    protected Set<GrantedAuthority> getAdditionalRoles(DirContextOperations user, String username) {
+        String userDn = user.getNameInNamespace();
+        username = user.getStringAttribute("cn");
+        return getGroupMembershipRoles(userDn, username);
+    }
 }