Active Directory Authentication Bad Credentials in search
I'm trying to using Spring Security 3.1.3 to connect to my company Active Directory through LDAP. . It seems I can connect but can't perform a search. If I use JXplorer I can connect using the same configurations. Here is my applicationContext-security.xml.
Code:
<authentication-manager>
<authentication-provider ref="ldapActiveDirectoryAuthProvider"/>
</authentication-manager>
<beans:bean id="ldapActiveDirectoryAuthProvider"
class="org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider">
<beans:constructor-arg value="mycompany.com" />
<beans:constructor-arg value="ldap://mycompany.com:3268" />
<beans:property name="convertSubErrorCodesToExceptions" value="true" />
</beans:bean>
The DEBUG result is bellow
Code:
DEBUG org.springframework.security.authentication.ProviderManager - Authentication attempt using org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider
DEBUG org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider - Processing authentication request for user: Mycompanyuser
DEBUG org.springframework.security.ldap.SpringSecurityLdapTemplate - Searching for entry under DN '', base = 'dc=mycompany,dc=com', filter = '(&(objectClass=user)(userPrincipalName={0}))'
DEBUG org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter - Authentication request failed: org.springframework.security.authentication.BadCredentialsException: Bad credentials
DEBUG org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter - Updated SecurityContextHolder to contain null Authentication
DEBUG org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter - Delegating to authentication failure handler org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler@7711089b
Does anybody have a clue?
Regards