Skip to content

Commit

Permalink
KYLIN-3197 When ldap is opened, I use an ignored case user to login, …
Browse files Browse the repository at this point in the history
…the page does not respond.

Signed-off-by: peng.jianhua <peng.jianhua@zte.com.cn>
  • Loading branch information
xingpeng1 authored and pengjianhua committed Feb 11, 2018
1 parent 3fa11b2 commit 2fd676b
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

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;
Expand All @@ -48,4 +49,11 @@ public Set<GrantedAuthority> getGroupMembershipRoles(String userDn, String usern
}
return userAuthorities;
}

@Override
protected Set<GrantedAuthority> getAdditionalRoles(DirContextOperations user, String username) {
String userDn = user.getNameInNamespace();
username = user.getStringAttribute("cn");
return getGroupMembershipRoles(userDn, username);
}
}

0 comments on commit 2fd676b

Please sign in to comment.