-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No password check when DefaultTlsDirContextAuthenticationStrategy is activated #430
Comments
FWIW, I ran up against this problem this week as well. Lots of hair pulling as to how the |
Thank you for the report. Unless someone comes up with another example, I'm closing this as invalid. Please see the explanation here #432 (comment) |
Five minutes of playing with @derTobsch's example project shows that this is not true; the exact same thing happens with anonymous search disabled. See my updated version here: /~https://github.com/espenhw/tls-bug-demo Edit: I can also reproduce this on an OpenLDAP installation with 'disallow bind_anon' set; this is not reflected in the example project |
Not sure why this is closed as invalid? This is pretty easy to replicate and clear to check in the code what is happening. The implementation claims to authenticate a user when it does no such thing |
@alex-sherwin @espenhw Thank you for the additional feedback. This is now merged into master. Please see my follow up comments on the PR. |
Since Java 9 this workaround is no longer necessary. Even worse, it leads to a memory leak and an open socket. Since Java 9, every call to |
@mschneid This issue is closed. Can you please create a new issue with details and a minimal but complete sample to reproduce? |
With the fix #430 the `DefaultTlsDirContextAuthenticationStrategy` was extended by the call of `ctx.reconnect(null);`. Due to the Java bug JDK-8217606 this call creates a second connection while the first connection remains open forever. fixes #502 see JDK-8217606 https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8217606
We stumbled over this problem one week ago and thought it would be nice to tell you about this.
When the
DefaultTlsDirContextAuthenticationStrategy
is set as authentication strategy on theLdapContextSource
every password will be accepted, because there happens no bind with user credentials against ldap.After deep debugging into your code and a lot of searching on the web, we found this post in the spring forum from Jul 18th, 2013.
http://forum.spring.io/forum/spring-projects/data/ldap/129629-ldap-with-tls-authentication-issues
mwebb describes very detailed the problem and gives an code example approach to fix this.
The problem he describes was exactly the same we had. The line
ctx.reconnect(null)
fixed it for us.The text was updated successfully, but these errors were encountered: