Skip to content

Commit

Permalink
Fix LDAP nested user search
Browse files Browse the repository at this point in the history
  • Loading branch information
apardyl committed Nov 15, 2018
1 parent af4b2ce commit c0604ac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ deploy:
skip_cleanup: true
api_key: "$GITHUB_TOKEN"
file_glob: true
file: build/libs/mordor*
file:
- build/libs/mordor*
- src/main/resources/application.properties
on:
repo: KSIUJ/mordor
tags: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class WebSecurityConfig(
private val userService: LocalUserService,
@Value("\${mordor.secret}") private val secret: String,
@Value("\${mordor.ldap.url:}") private val ldapUrl: String,
@Value("\${mordor.ldap.userdn:}") private val userDnPatterns: String,
@Value("\${mordor.ldap.user.base:}") private val userBase: String,
@Value("\${mordor.ldap.user.filter:}") private val userFilter: String,
private val ldapRolePopulator: LdapRolePopulator
) : WebSecurityConfigurerAdapter() {

Expand All @@ -40,7 +41,8 @@ class WebSecurityConfig(

if (ldapUrl.isNotEmpty()) {
auth.ldapAuthentication()
.userDnPatterns(userDnPatterns)
.userSearchBase(userBase)
.userSearchFilter(userFilter)
.contextSource().url(ldapUrl)
.and().ldapAuthoritiesPopulator(ldapRolePopulator)
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ mordor.secret=CHANGE_THIS_FOR_PRODUCTION
mordor.allow_user_registration=true
# LDAP settings
#mordor.ldap.url=ldap://10.20.10.10/cn=accounts,dc=ksi,dc=ii,dc=uj,dc=edu,dc=pl
#mordor.ldap.userdn=uid={0},cn=users
#mordor.ldap.user.base=cn=users
#mordor.ldap.user.filter=uid={0}
#mordor.ldap.role.admin=cn=admins,cn=groups,cn=accounts,dc=ksi,dc=ii,dc=uj,dc=edu,dc=pl
#mordor.ldap.role.mod=cn=mordor,cn=groups,cn=accounts,dc=ksi,dc=ii,dc=uj,dc=edu,dc=pl
# Development settings
Expand Down

0 comments on commit c0604ac

Please sign in to comment.