Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
3b1a7d09
Commit
3b1a7d09
authored
Dec 13, 2016
by
nixonrodrigues
Committed by
Madhan Neethiraj
Dec 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1377: fix for Escaping comma in for LDAP properties
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
05bdbc62
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
32 deletions
+62
-32
atlas-application.properties
distro/src/conf/atlas-application.properties
+6
-6
AtlasADAuthenticationProvider.java
...che/atlas/web/security/AtlasADAuthenticationProvider.java
+26
-8
AtlasLdapAuthenticationProvider.java
...e/atlas/web/security/AtlasLdapAuthenticationProvider.java
+30
-18
No files found.
distro/src/conf/atlas-application.properties
View file @
3b1a7d09
...
...
@@ -114,12 +114,12 @@ atlas.authentication.method.file.filename=${sys:atlas.home}/conf/users-credentia
######## LDAP properties #########
#atlas.authentication.method.ldap.url=ldap://<ldap server url>:389
#atlas.authentication.method.ldap.userDNpattern=uid={0}
\,ou=People\,dc=example\
,dc=com
#atlas.authentication.method.ldap.groupSearchBase=dc=example
\
,dc=com
#atlas.authentication.method.ldap.groupSearchFilter=(member=uid={0}
\,ou=Users\,dc=example\
,dc=com)
#atlas.authentication.method.ldap.userDNpattern=uid={0}
,ou=People,dc=example
,dc=com
#atlas.authentication.method.ldap.groupSearchBase=dc=example,dc=com
#atlas.authentication.method.ldap.groupSearchFilter=(member=uid={0}
,ou=Users,dc=example
,dc=com)
#atlas.authentication.method.ldap.groupRoleAttribute=cn
#atlas.authentication.method.ldap.base.dn=dc=example
\
,dc=com
#atlas.authentication.method.ldap.bind.dn=cn=Manager
\,dc=example\
,dc=com
#atlas.authentication.method.ldap.base.dn=dc=example,dc=com
#atlas.authentication.method.ldap.bind.dn=cn=Manager
,dc=example
,dc=com
#atlas.authentication.method.ldap.bind.password=<password>
#atlas.authentication.method.ldap.referral=ignore
#atlas.authentication.method.ldap.user.searchfilter=(uid={0})
...
...
@@ -130,7 +130,7 @@ atlas.authentication.method.file.filename=${sys:atlas.home}/conf/users-credentia
#atlas.authentication.method.ldap.ad.domain=example.com
#atlas.authentication.method.ldap.ad.url=ldap://<AD server url>:389
#atlas.authentication.method.ldap.ad.base.dn=(sAMAccountName={0})
#atlas.authentication.method.ldap.ad.bind.dn=CN=team
\,CN=Users\,DC=example\
,DC=com
#atlas.authentication.method.ldap.ad.bind.dn=CN=team
,CN=Users,DC=example
,DC=com
#atlas.authentication.method.ldap.ad.bind.password=<password>
#atlas.authentication.method.ldap.ad.referral=ignore
#atlas.authentication.method.ldap.ad.user.searchfilter=(sAMAccountName={0})
...
...
webapp/src/main/java/org/apache/atlas/web/security/AtlasADAuthenticationProvider.java
View file @
3b1a7d09
...
...
@@ -19,12 +19,14 @@
package
org
.
apache
.
atlas
.
web
.
security
;
import
java.util.List
;
import
java.util.Properties
;
import
javax.annotation.PostConstruct
;
import
org.apache.atlas.ApplicationProperties
;
import
org.apache.atlas.web.model.User
;
import
org.apache.commons.configuration.Configuration
;
import
org.apache.commons.configuration.ConfigurationConverter
;
import
org.apache.log4j.Logger
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.core.Authentication
;
...
...
@@ -105,16 +107,32 @@ public class AtlasADAuthenticationProvider extends
try
{
Configuration
configuration
=
ApplicationProperties
.
get
();
this
.
adDomain
=
configuration
.
getString
(
"atlas.authentication.method.ldap.ad.domain"
);
this
.
adURL
=
configuration
.
getString
(
"atlas.authentication.method.ldap.ad.url"
);
this
.
adBindDN
=
configuration
.
getString
(
"atlas.authentication.method.ldap.ad.bind.dn"
);
this
.
adBindPassword
=
configuration
.
getString
(
"atlas.authentication.method.ldap.ad.bind.password"
);
this
.
adUserSearchFilter
=
configuration
.
getString
(
"atlas.authentication.method.ldap.ad.user.searchfilter"
);
this
.
adBase
=
configuration
.
getString
(
"atlas.authentication.method.ldap.ad.base.dn"
);
this
.
adReferral
=
configuration
.
getString
(
"atlas.authentication.method.ldap.ad.referral"
);
this
.
adDefaultRole
=
configuration
.
getString
(
"atlas.authentication.method.ldap.ad.default.role"
);
Properties
properties
=
ConfigurationConverter
.
getProperties
(
configuration
.
subset
(
"atlas.authentication.method.ldap.ad"
));
this
.
adDomain
=
properties
.
getProperty
(
"domain"
);
this
.
adURL
=
properties
.
getProperty
(
"url"
);
this
.
adBindDN
=
properties
.
getProperty
(
"bind.dn"
);
this
.
adBindPassword
=
properties
.
getProperty
(
"bind.password"
);
this
.
adUserSearchFilter
=
properties
.
getProperty
(
"user.searchfilter"
);
this
.
adBase
=
properties
.
getProperty
(
"base.dn"
);
this
.
adReferral
=
properties
.
getProperty
(
"referral"
);
this
.
adDefaultRole
=
properties
.
getProperty
(
"default.role"
);
this
.
groupsFromUGI
=
configuration
.
getBoolean
(
"atlas.authentication.method.ldap.ugi-groups"
,
true
);
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"AtlasADAuthenticationProvider{"
+
"adURL='"
+
adURL
+
'\''
+
", adDomain='"
+
adDomain
+
'\''
+
", adBindDN='"
+
adBindDN
+
'\''
+
", adUserSearchFilter='"
+
adUserSearchFilter
+
'\''
+
", adBase='"
+
adBase
+
'\''
+
", adReferral='"
+
adReferral
+
'\''
+
", adDefaultRole='"
+
adDefaultRole
+
'\''
+
", groupsFromUGI="
+
groupsFromUGI
+
'}'
);
}
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Exception while setADProperties"
,
e
);
}
...
...
webapp/src/main/java/org/apache/atlas/web/security/AtlasLdapAuthenticationProvider.java
View file @
3b1a7d09
...
...
@@ -19,10 +19,12 @@
package
org
.
apache
.
atlas
.
web
.
security
;
import
java.util.List
;
import
java.util.Properties
;
import
javax.annotation.PostConstruct
;
import
org.apache.atlas.ApplicationProperties
;
import
org.apache.atlas.web.model.User
;
import
org.apache.commons.configuration.Configuration
;
import
org.apache.commons.configuration.ConfigurationConverter
;
import
org.apache.log4j.Logger
;
import
org.springframework.ldap.core.support.LdapContextSource
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
...
...
@@ -127,26 +129,36 @@ public class AtlasLdapAuthenticationProvider extends
private
void
setLdapProperties
()
{
try
{
Configuration
configuration
=
ApplicationProperties
.
get
();
ldapURL
=
configuration
.
getString
(
"atlas.authentication.method.ldap.url"
);
ldapUserDNPattern
=
configuration
.
getString
(
"atlas.authentication.method.ldap.userDNpattern"
);
ldapGroupSearchBase
=
configuration
.
getString
(
"atlas.authentication.method.ldap.groupSearchBase"
);
ldapGroupSearchFilter
=
configuration
.
getString
(
"atlas.authentication.method.ldap.groupSearchFilter"
);
ldapGroupRoleAttribute
=
configuration
.
getString
(
"atlas.authentication.method.ldap.groupRoleAttribute"
);
ldapBindDN
=
configuration
.
getString
(
"atlas.authentication.method.ldap.bind.dn"
);
ldapBindPassword
=
configuration
.
getString
(
"atlas.authentication.method.ldap.bind.password"
);
ldapDefaultRole
=
configuration
.
getString
(
"atlas.authentication.method.ldap.default.role"
);
ldapUserSearchFilter
=
configuration
.
getString
(
"atlas.authentication.method.ldap.user.searchfilter"
);
ldapReferral
=
configuration
.
getString
(
"atlas.authentication.method.ldap.ad.referral"
);
ldapBase
=
configuration
.
getString
(
"atlas.authentication.method.ldap.base.dn"
);
Properties
properties
=
ConfigurationConverter
.
getProperties
(
configuration
.
subset
(
"atlas.authentication.method.ldap"
));
ldapURL
=
properties
.
getProperty
(
"url"
);
ldapUserDNPattern
=
properties
.
getProperty
(
"userDNpattern"
);
ldapGroupSearchBase
=
properties
.
getProperty
(
"groupSearchBase"
);
ldapGroupSearchFilter
=
properties
.
getProperty
(
"groupSearchFilter"
);
ldapGroupRoleAttribute
=
properties
.
getProperty
(
"groupRoleAttribute"
);
ldapBindDN
=
properties
.
getProperty
(
"bind.dn"
);
ldapBindPassword
=
properties
.
getProperty
(
"bind.password"
);
ldapDefaultRole
=
properties
.
getProperty
(
"default.role"
);
ldapUserSearchFilter
=
properties
.
getProperty
(
"user.searchfilter"
);
ldapReferral
=
properties
.
getProperty
(
"referral"
);
ldapBase
=
properties
.
getProperty
(
"base.dn"
);
groupsFromUGI
=
configuration
.
getBoolean
(
"atlas.authentication.method.ldap.ugi-groups"
,
true
);
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"AtlasLdapAuthenticationProvider{"
+
"ldapURL='"
+
ldapURL
+
'\''
+
", ldapUserDNPattern='"
+
ldapUserDNPattern
+
'\''
+
", ldapGroupSearchBase='"
+
ldapGroupSearchBase
+
'\''
+
", ldapGroupSearchFilter='"
+
ldapGroupSearchFilter
+
'\''
+
", ldapGroupRoleAttribute='"
+
ldapGroupRoleAttribute
+
'\''
+
", ldapBindDN='"
+
ldapBindDN
+
'\''
+
", ldapDefaultRole='"
+
ldapDefaultRole
+
'\''
+
", ldapUserSearchFilter='"
+
ldapUserSearchFilter
+
'\''
+
", ldapReferral='"
+
ldapReferral
+
'\''
+
", ldapBase='"
+
ldapBase
+
'\''
+
", groupsFromUGI="
+
groupsFromUGI
+
'}'
);
}
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Exception while setLdapProperties"
,
e
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment