question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EmbeddedLdapAutoConfiguration not setting the base information into the LdapContextSource

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
snicollcommented, Jan 19, 2018

Then, you closed PR #10444 which isn’t progressing since then.

It hasn’t progressed because the proposal was unsatisfactory. But you’re right, looking back at the history, we could use a report for this. Let’s use this one then.

2reactions
vdubuscommented, Jan 19, 2018

Ok, so because PR #10444 was made to fix Issue #10443, you closed the issue as a duplicate of the PR. Then, you closed PR #10444 which isn’t progressing since then. And now you closed this ticket which report back the problem as a bug. Meaning that there isn’t even an opened ticket to signal the bug.

Would you mind reopening at least one ticket so that someone could find it and try working on it? Unless there is another opened ticket of which I am unaware?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring LDAP Spring Ldap Embedded doesn't set ...
I got around this with the following: @Bean public LdapContextSource createLdapConfig(LdapProperties properties, Environment environment, ...
Read more >
Spring LDAP Reference
Spring LDAP makes it easier to build Spring-based applications ... information on how the library helps when working with LdapName objects.
Read more >
Java Examples for org.springframework.ldap.core.support ...
This java examples will help you to understand the usage of org.springframework.ldap.core.support.LdapContextSource. These source code samples are taken ...
Read more >
Spring Boot Reference Guide
Exposing YAML as Properties in the Spring Environment . ... Converting Data Sizes . ... An LdapContextSource is auto-configured based on these settings....
Read more >
Spring LDAP Overview - Baeldung
When we are working on a Spring Boot project, we can use Spring Boot Starter Data Ldap dependency that will automatically instrument ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found