Commit 8481e84d authored by Daniel Gerhardt's avatar Daniel Gerhardt

Do not try to set up LDAP if no server URL is set

parent e9c6f33b
......@@ -33,9 +33,11 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
auth.inMemoryAuthentication().withUser(username)
.password(password).authorities("ADMIN");
auth.ldapAuthentication().contextSource(ldapContextSource())
.userSearchBase(ldapUserSearchBase)
.userSearchFilter(ldapUserSearchFilter);
if (!"".equals(ldapServerUrl)) {
auth.ldapAuthentication().contextSource(ldapContextSource())
.userSearchBase(ldapUserSearchBase)
.userSearchFilter(ldapUserSearchFilter);
}
}
@Bean
......@@ -51,7 +53,11 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Bean
public BaseLdapPathContextSource ldapContextSource() {
return new DefaultSpringSecurityContextSource(ldapServerUrl);
if (!"".equals(ldapServerUrl)) {
return new DefaultSpringSecurityContextSource(ldapServerUrl);
}
return null;
}
@Override
......
......@@ -12,4 +12,8 @@ dao.implementation=de.thm.arsnova.connector.dao.MoodleConnectorDaoImpl
# dao.implementation=de.thm.arsnova.connector.dao.DummyConnectorDaoImpl
admin.username=test
admin.password=test
\ No newline at end of file
admin.password=test
ldap.serverUrl=
ldap.userSearchBase=
ldap.userSearchFilter=
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment