diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapRealm.java b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapRealm.java index e33385a436b..bf8692b5b4c 100644 --- a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapRealm.java +++ b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapRealm.java @@ -269,7 +269,7 @@ protected AuthenticationInfo queryForAuthenticationInfo(AuthenticationToken toke /** * Get groups from LDAP. - * + * * @param principals * the principals of the Subject whose AuthenticationInfo should * be queried from the LDAP server. @@ -353,8 +353,8 @@ protected Set rolesFor(PrincipalCollection principals, String userNameIn byte[] cookie = null; try { ldapCtx.addToEnvironment(Context.REFERRAL, "ignore"); - - ldapCtx.setRequestControls(new Control[]{new PagedResultsControl(pageSize, + + ldapCtx.setRequestControls(new Control[]{new PagedResultsControl(pageSize, Control.NONCRITICAL)}); do { @@ -376,7 +376,7 @@ protected Set rolesFor(PrincipalCollection principals, String userNameIn final SearchResult group = searchResultEnum.next(); Attribute attribute = group.getAttributes().get(getGroupIdAttribute()); - String groupName = attribute.get().toString(); + String groupName = attribute.get().toString(); String roleName = roleNameFor(groupName); if (roleName != null) { @@ -601,7 +601,7 @@ public void setGroupIdAttribute(String groupIdAttribute) { /** * Set Member Attribute Template for LDAP. - * + * * @param template * DN template to be used to query ldap. * @throws IllegalArgumentException @@ -658,7 +658,7 @@ public String getUserSearchAttributeName() { /** * Set User Search Attribute Name for LDAP. - * + * * @param userSearchAttributeName * userAttribute to search ldap. */ @@ -718,14 +718,14 @@ boolean isUserMemberOfDynamicGroup(LdapName userLdapDn, String memberUrl, LdapName searchBaseDn = new LdapName(searchBaseString); // do scope test - if (searchScope.equalsIgnoreCase("base")) { + if ("base".equalsIgnoreCase(searchScope)) { log.debug("DynamicGroup SearchScope base"); return false; } if (!userLdapDn.toString().endsWith(searchBaseDn.toString())) { return false; } - if (searchScope.equalsIgnoreCase("one") && (userLdapDn.size() != searchBaseDn.size() - 1)) { + if ("one".equalsIgnoreCase(searchScope) && (userLdapDn.size() != searchBaseDn.size() - 1)) { log.debug("DynamicGroup SearchScope one"); return false; } @@ -737,7 +737,7 @@ boolean isUserMemberOfDynamicGroup(LdapName userLdapDn, String memberUrl, NamingEnumeration searchResultEnum = null; try { searchResultEnum = systemLdapCtx.search(userLdapDn, searchFilter, - searchScope.equalsIgnoreCase("sub") ? SUBTREE_SCOPE : ONELEVEL_SCOPE); + "sub".equalsIgnoreCase(searchScope) ? SUBTREE_SCOPE : ONELEVEL_SCOPE); if (searchResultEnum.hasMore()) { return true; } @@ -759,7 +759,7 @@ public String getPrincipalRegex() { /** * Set Regex for Principal LDAP. - * + * * @param regex * regex to use to search for principal in shiro. */