Commit aaeddd38 by Péter Gergő Barna Committed by Madhan Neethiraj

ATLAS-2172: Atlas AD search filter is not get honored when logging into Atlas UI

parent 9e59fabe
......@@ -93,9 +93,6 @@ public class AtlasADAuthenticationProvider extends AtlasAbstractAuthenticationPr
ldapContextSource.setPooled(true);
ldapContextSource.afterPropertiesSet();
if (adUserSearchFilter==null || adUserSearchFilter.trim().isEmpty()) {
adUserSearchFilter="(sAMAccountName={0})";
}
FilterBasedLdapUserSearch userSearch=new FilterBasedLdapUserSearch(adBase, adUserSearchFilter,ldapContextSource);
userSearch.setSearchSubtree(true);
......@@ -140,6 +137,7 @@ public class AtlasADAuthenticationProvider extends AtlasAbstractAuthenticationPr
new ActiveDirectoryLdapAuthenticationProvider(adDomain, adURL);
adAuthenticationProvider.setConvertSubErrorCodesToExceptions(true);
adAuthenticationProvider.setUseAuthenticationRequestCredentials(true);
adAuthenticationProvider.setSearchFilter(adUserSearchFilter);
if (userName != null && userPassword != null
&& !userName.trim().isEmpty()
......@@ -174,6 +172,9 @@ public class AtlasADAuthenticationProvider extends AtlasAbstractAuthenticationPr
this.adBindDN = properties.getProperty("bind.dn");
this.adBindPassword = properties.getProperty("bind.password");
this.adUserSearchFilter = properties.getProperty("user.searchfilter");
if (adUserSearchFilter==null || adUserSearchFilter.trim().isEmpty()) {
adUserSearchFilter="(sAMAccountName={0})";
}
this.adBase = properties.getProperty("base.dn");
this.adReferral = properties.getProperty("referral");
this.adDefaultRole = properties.getProperty("default.role");
......
......@@ -15,7 +15,7 @@
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
<context:annotation-config/>
<aop:config proxy-target-class="true"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment