Thank you for the PR. However we are already setting the SECURITY_PRINCIPAL and the SECURITY_CREDENTIALS whenever we connect to LDAP which you can see here.
@chrisgray You are right, sorry for the noise. I thought this was needed when looking at the code, but not sure how I couldn't get it to work initially, but it works now without this patch.
Thank you for the PR. However we are already setting the SECURITY_PRINCIPAL and the SECURITY_CREDENTIALS whenever we connect to LDAP which you can see here.
https://github.com/bigloser/dropwizard-auth-ldap/blob/dd90e91ecc2874e1540c47ae5372a2f2479aeaf6/src/main/java/com/yammer/dropwizard/authenticator/LdapAuthenticator.java#L120-L121
The documentation states that it should switch the authentication mechanism from none to simple if these are supplied. I could have read this wrong. https://docs.oracle.com/javase/tutorial/jndi/ldap/auth_mechs.html
If you do something like:
env.put(Context.SECURITY_AUTHENTICATION, "simple");
Does it solve your issue? That would significantly reduce your PR.