You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ma...@apache.org on 2017/09/26 21:01:44 UTC

[2/2] atlas git commit: ATLAS-2172: Atlas AD search filter is not get honored when logging into Atlas UI

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

Signed-off-by: Madhan Neethiraj <ma...@apache.org>


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

Branch: refs/heads/master
Commit: aaeddd38730ed0ddb69b8ea4712082994a86e403
Parents: 9e59fab
Author: Péter Gergő Barna <bp...@gmail.com>
Authored: Tue Sep 26 13:36:27 2017 -0700
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Tue Sep 26 13:36:27 2017 -0700

----------------------------------------------------------------------
 .../atlas/web/security/AtlasADAuthenticationProvider.java     | 7 ++++---
 webapp/src/main/webapp/WEB-INF/applicationContext.xml         | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/aaeddd38/webapp/src/main/java/org/apache/atlas/web/security/AtlasADAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/webapp/src/main/java/org/apache/atlas/web/security/AtlasADAuthenticationProvider.java b/webapp/src/main/java/org/apache/atlas/web/security/AtlasADAuthenticationProvider.java
index b123c52..4f612eb 100644
--- a/webapp/src/main/java/org/apache/atlas/web/security/AtlasADAuthenticationProvider.java
+++ b/webapp/src/main/java/org/apache/atlas/web/security/AtlasADAuthenticationProvider.java
@@ -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");

http://git-wip-us.apache.org/repos/asf/atlas/blob/aaeddd38/webapp/src/main/webapp/WEB-INF/applicationContext.xml
----------------------------------------------------------------------
diff --git a/webapp/src/main/webapp/WEB-INF/applicationContext.xml b/webapp/src/main/webapp/WEB-INF/applicationContext.xml
index aae2aa0..2ecd8d1 100644
--- a/webapp/src/main/webapp/WEB-INF/applicationContext.xml
+++ b/webapp/src/main/webapp/WEB-INF/applicationContext.xml
@@ -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"/>