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
8 years ago
by
nixonrodrigues
Committed by
Madhan Neethiraj
8 years ago
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
master
No related merge requests found
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
...
@@ -114,12 +114,12 @@ atlas.authentication.method.file.filename=${sys:atlas.home}/conf/users-credentia
######## LDAP properties #########
######## LDAP properties #########
#atlas.authentication.method.ldap.url=ldap://<ldap server url>:389
#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.userDNpattern=uid={0}
,ou=People,dc=example
,dc=com
#atlas.authentication.method.ldap.groupSearchBase=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.groupSearchFilter=(member=uid={0}
,ou=Users,dc=example
,dc=com)
#atlas.authentication.method.ldap.groupRoleAttribute=cn
#atlas.authentication.method.ldap.groupRoleAttribute=cn
#atlas.authentication.method.ldap.base.dn=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.dn=cn=Manager
,dc=example
,dc=com
#atlas.authentication.method.ldap.bind.password=<password>
#atlas.authentication.method.ldap.bind.password=<password>
#atlas.authentication.method.ldap.referral=ignore
#atlas.authentication.method.ldap.referral=ignore
#atlas.authentication.method.ldap.user.searchfilter=(uid={0})
#atlas.authentication.method.ldap.user.searchfilter=(uid={0})
...
@@ -130,7 +130,7 @@ atlas.authentication.method.file.filename=${sys:atlas.home}/conf/users-credentia
...
@@ -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.domain=example.com
#atlas.authentication.method.ldap.ad.url=ldap://<AD server url>:389
#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.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.bind.password=<password>
#atlas.authentication.method.ldap.ad.referral=ignore
#atlas.authentication.method.ldap.ad.referral=ignore
#atlas.authentication.method.ldap.ad.user.searchfilter=(sAMAccountName={0})
#atlas.authentication.method.ldap.ad.user.searchfilter=(sAMAccountName={0})
...
...
This diff is collapsed.
Click to expand it.
webapp/src/main/java/org/apache/atlas/web/security/AtlasADAuthenticationProvider.java
View file @
3b1a7d09
...
@@ -19,12 +19,14 @@
...
@@ -19,12 +19,14 @@
package
org
.
apache
.
atlas
.
web
.
security
;
package
org
.
apache
.
atlas
.
web
.
security
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Properties
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
org.apache.atlas.ApplicationProperties
;
import
org.apache.atlas.ApplicationProperties
;
import
org.apache.atlas.web.model.User
;
import
org.apache.atlas.web.model.User
;
import
org.apache.commons.configuration.Configuration
;
import
org.apache.commons.configuration.Configuration
;
import
org.apache.commons.configuration.ConfigurationConverter
;
import
org.apache.log4j.Logger
;
import
org.apache.log4j.Logger
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.Authentication
;
...
@@ -105,16 +107,32 @@ public class AtlasADAuthenticationProvider extends
...
@@ -105,16 +107,32 @@ public class AtlasADAuthenticationProvider extends
try
{
try
{
Configuration
configuration
=
ApplicationProperties
.
get
();
Configuration
configuration
=
ApplicationProperties
.
get
();
this
.
adDomain
=
configuration
.
getString
(
"atlas.authentication.method.ldap.ad.domain"
);
Properties
properties
=
ConfigurationConverter
.
getProperties
(
configuration
.
subset
(
"atlas.authentication.method.ldap.ad"
));
this
.
adURL
=
configuration
.
getString
(
"atlas.authentication.method.ldap.ad.url"
);
this
.
adDomain
=
properties
.
getProperty
(
"domain"
);
this
.
adBindDN
=
configuration
.
getString
(
"atlas.authentication.method.ldap.ad.bind.dn"
);
this
.
adURL
=
properties
.
getProperty
(
"url"
);
this
.
adBindPassword
=
configuration
.
getString
(
"atlas.authentication.method.ldap.ad.bind.password"
);
this
.
adBindDN
=
properties
.
getProperty
(
"bind.dn"
);
this
.
adUserSearchFilter
=
configuration
.
getString
(
"atlas.authentication.method.ldap.ad.user.searchfilter"
);
this
.
adBindPassword
=
properties
.
getProperty
(
"bind.password"
);
this
.
adBase
=
configuration
.
getString
(
"atlas.authentication.method.ldap.ad.base.dn"
);
this
.
adUserSearchFilter
=
properties
.
getProperty
(
"user.searchfilter"
);
this
.
adReferral
=
configuration
.
getString
(
"atlas.authentication.method.ldap.ad.referral"
);
this
.
adBase
=
properties
.
getProperty
(
"base.dn"
);
this
.
adDefaultRole
=
configuration
.
getString
(
"atlas.authentication.method.ldap.ad.default.role"
);
this
.
adReferral
=
properties
.
getProperty
(
"referral"
);
this
.
adDefaultRole
=
properties
.
getProperty
(
"default.role"
);
this
.
groupsFromUGI
=
configuration
.
getBoolean
(
"atlas.authentication.method.ldap.ugi-groups"
,
true
);
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
)
{
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Exception while setADProperties"
,
e
);
LOG
.
error
(
"Exception while setADProperties"
,
e
);
}
}
...
...
This diff is collapsed.
Click to expand it.
webapp/src/main/java/org/apache/atlas/web/security/AtlasLdapAuthenticationProvider.java
View file @
3b1a7d09
...
@@ -19,10 +19,12 @@
...
@@ -19,10 +19,12 @@
package
org
.
apache
.
atlas
.
web
.
security
;
package
org
.
apache
.
atlas
.
web
.
security
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Properties
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
org.apache.atlas.ApplicationProperties
;
import
org.apache.atlas.ApplicationProperties
;
import
org.apache.atlas.web.model.User
;
import
org.apache.atlas.web.model.User
;
import
org.apache.commons.configuration.Configuration
;
import
org.apache.commons.configuration.Configuration
;
import
org.apache.commons.configuration.ConfigurationConverter
;
import
org.apache.log4j.Logger
;
import
org.apache.log4j.Logger
;
import
org.springframework.ldap.core.support.LdapContextSource
;
import
org.springframework.ldap.core.support.LdapContextSource
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
...
@@ -127,26 +129,36 @@ public class AtlasLdapAuthenticationProvider extends
...
@@ -127,26 +129,36 @@ public class AtlasLdapAuthenticationProvider extends
private
void
setLdapProperties
()
{
private
void
setLdapProperties
()
{
try
{
try
{
Configuration
configuration
=
ApplicationProperties
.
get
();
Configuration
configuration
=
ApplicationProperties
.
get
();
Properties
properties
=
ConfigurationConverter
.
getProperties
(
configuration
.
subset
(
"atlas.authentication.method.ldap"
));
ldapURL
=
configuration
.
getString
(
"atlas.authentication.method.ldap.url"
);
ldapURL
=
properties
.
getProperty
(
"url"
);
ldapUserDNPattern
=
configuration
.
getString
(
ldapUserDNPattern
=
properties
.
getProperty
(
"userDNpattern"
);
"atlas.authentication.method.ldap.userDNpattern"
);
ldapGroupSearchBase
=
properties
.
getProperty
(
"groupSearchBase"
);
ldapGroupSearchBase
=
configuration
.
getString
(
ldapGroupSearchFilter
=
properties
.
getProperty
(
"groupSearchFilter"
);
"atlas.authentication.method.ldap.groupSearchBase"
);
ldapGroupRoleAttribute
=
properties
.
getProperty
(
"groupRoleAttribute"
);
ldapGroupSearchFilter
=
configuration
.
getString
(
ldapBindDN
=
properties
.
getProperty
(
"bind.dn"
);
"atlas.authentication.method.ldap.groupSearchFilter"
);
ldapBindPassword
=
properties
.
getProperty
(
"bind.password"
);
ldapGroupRoleAttribute
=
configuration
.
getString
(
ldapDefaultRole
=
properties
.
getProperty
(
"default.role"
);
"atlas.authentication.method.ldap.groupRoleAttribute"
);
ldapUserSearchFilter
=
properties
.
getProperty
(
"user.searchfilter"
);
ldapBindDN
=
configuration
.
getString
(
"atlas.authentication.method.ldap.bind.dn"
);
ldapReferral
=
properties
.
getProperty
(
"referral"
);
ldapBindPassword
=
configuration
.
getString
(
ldapBase
=
properties
.
getProperty
(
"base.dn"
);
"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"
);
groupsFromUGI
=
configuration
.
getBoolean
(
"atlas.authentication.method.ldap.ugi-groups"
,
true
);
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
)
{
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Exception while setLdapProperties"
,
e
);
LOG
.
error
(
"Exception while setLdapProperties"
,
e
);
}
}
...
...
This diff is collapsed.
Click to expand it.
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