atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject atlas git commit: ATLAS-2172: Atlas AD search filter is not get honored when logging into Atlas UI
Date Tue, 26 Sep 2017 21:07:11 GMT
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 36c2e3c09 -> 50980f7a9


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

Signed-off-by: Madhan Neethiraj <madhan@apache.org>
(cherry picked from commit aaeddd38730ed0ddb69b8ea4712082994a86e403)


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

Branch: refs/heads/branch-0.8
Commit: 50980f7a92e737c6f1cc9842f0cdf9392760a060
Parents: 36c2e3c
Author: Péter Gergő Barna <bpgergo@gmail.com>
Authored: Tue Sep 26 13:36:27 2017 -0700
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Tue Sep 26 14:05:58 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/50980f7a/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/50980f7a/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"/>


Mime
View raw message