-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Closed
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply
Description
Currently (as of version 2.0.0.M7), EmbeddedLdapAutoConfiguration isn't properly setting the base information from LdapContextSource using the value from spring.ldap.embedded.base-dn.
Because of that, we can't test our @repository classes using an embedded LDAP server without overriding this bean unless if we want to set the whole path for each @Entry.
I would suggest the following change inside of org.springframework.boot.autoconfigure.ldap.embedded.EmbeddedLdapAutoConfiguration#ldapContextSource:
@Bean
@DependsOn("directoryServer")
@ConditionalOnMissingBean
public ContextSource ldapContextSource() {
LdapContextSource source = new LdapContextSource();
if (hasCredentials(this.embeddedProperties.getCredential())) {
source.setUserDn(this.embeddedProperties.getCredential().getUsername());
source.setPassword(this.embeddedProperties.getCredential().getPassword());
}
source.setBase(this.embeddedProperties.getBaseDn()); // Add this line.
source.setUrls(this.properties.determineUrls(this.environment));
return source;
}This issue was already reported in the issue #10443 which was closed without fixing the problem.
Metadata
Metadata
Assignees
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply