diff --git a/.travis.yml b/.travis.yml index bc8b3c0..7a6e679 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/src/main/kotlin/pl/edu/uj/ii/ksi/mordor/configuration/WebSecurityConfig.kt b/src/main/kotlin/pl/edu/uj/ii/ksi/mordor/configuration/WebSecurityConfig.kt index 2a28dc0..3a0a864 100644 --- a/src/main/kotlin/pl/edu/uj/ii/ksi/mordor/configuration/WebSecurityConfig.kt +++ b/src/main/kotlin/pl/edu/uj/ii/ksi/mordor/configuration/WebSecurityConfig.kt @@ -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() { @@ -40,7 +41,8 @@ class WebSecurityConfig( if (ldapUrl.isNotEmpty()) { auth.ldapAuthentication() - .userDnPatterns(userDnPatterns) + .userSearchBase(userBase) + .userSearchFilter(userFilter) .contextSource().url(ldapUrl) .and().ldapAuthoritiesPopulator(ldapRolePopulator) } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 12cec11..bd4e1d8 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -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