Skip to content
Snippets Groups Projects
Commit ec1b4afc authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Add support for an LDAP manager user

parent 3da8a3c9
Branches
Tags
1 merge request!12Add support for LDAP manager and search
......@@ -98,7 +98,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter implements Serv
@Value("${security.ldap.enabled}") private boolean ldapEnabled;
@Value("${security.ldap.url}") private String ldapUrl;
@Value("${security.ldap.user-dn-pattern}") private String ldapUserDn;
@Value("${security.ldap.user-dn-pattern:}") private String ldapUserDn;
@Value("${security.ldap.manager-user-dn:}") private String ldapManagerUserDn;
@Value("${security.ldap.manager-password:}") private String ldapManagerPassword;
@Value("${security.cas.enabled}") private boolean casEnabled;
@Value("${security.cas-server-url}") private String casUrl;
......@@ -254,8 +256,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter implements Serv
public LdapContextSource ldapContextSource() throws Exception {
DefaultSpringSecurityContextSource contextSource = new DefaultSpringSecurityContextSource(ldapUrl);
/* TODO: implement support for LDAP bind using manager credentials */
// contextSource.setUserDn(ldapManagerUserDn);
// contextSource.setPassword(ldapManagerPassword);
if (!"".equals(ldapManagerUserDn) && !"".equals(ldapManagerPassword)) {
contextSource.setUserDn(ldapManagerUserDn);
contextSource.setPassword(ldapManagerPassword);
}
return contextSource;
}
......
......@@ -112,9 +112,9 @@ security.ldap.image=
security.ldap.order=0
security.ldap.url=ldap://example.com:33389/dc=example,dc=com
security.ldap.user-dn-pattern=uid={0},ou=arsnova
# Not yet implemented parameters
#security.ldap.user-search-filter=(uid={0})
#security.ldap.user-search-base="ou=people"
# Configure the LDAP manager user if anonymous binding is not allowed
#security.ldap.manager-user-dn=cn=arsnova-manager,dc=example,dc=com
#security.ldap.manager-password=arsnova
# CAS authentication
#
......
......@@ -112,9 +112,9 @@ security.ldap.image=
security.ldap.order=0
security.ldap.url=ldap://example.com:33389/dc=example,dc=com
security.ldap.user-dn-pattern=uid={0},ou=arsnova
# Not yet implemented parameters
#security.ldap.user-search-filter=(uid={0})
#security.ldap.user-search-base="ou=people"
# Configure the LDAP manager user if anonymous binding is not allowed
#security.ldap.manager-user-dn=cn=arsnova-manager,dc=example,dc=com
#security.ldap.manager-password=arsnova
# CAS authentication
#
......
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