Results 1 to 2 of 2

Thread: Active Directory Authentication Bad Credentials in search

  1. #1
    Join Date
    Nov 2012
    Posts
    1

    Default 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

  2. #2
    Join Date
    Nov 2012
    Posts
    1

    Default

    Check out this link: http://www.isharecodes.com/2012/11/g...plugin-to.html
    That configuration is working to me as well.

    Quote Originally Posted by kinder View Post
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •