Hi,
   
  I am new to LDAP and I am running a tutorial where I am doing a form based 
login authentication using 
  org.acegisecurity.providers.ldap.LdapAuthenticationProvider.
   
  I have installed CDSSilver openldap for windows and I am using the sample 
database that come with the installation.  I am using JXplorer and I am able to 
connect to the LDAP server and search for entries. 
   
  I am not able to authenticate the user thru my code. I keep getting this 
error message:
  WARNING: Authentication event AuthenticationFailureBadCredentialsEvent: 
Hoa_Dandurand; details: [EMAIL PROTECTED]: RemoteIpAddress: 127.0.0.1; 
SessionId: 4B11A7D41D928A07D8409449DCFB38E4; exception: Bad credentials
   
  here his the portion of my applicationContext-acegi-security.xml config for 
LDAP. What am I  doing wrong ?  Thanks for any insight on this issue.
   
  <bean id="authenticationManager"
  class="org.acegisecurity.providers.ProviderManager">
  <property name="providers">
  <list>
  <ref local="ldapAuthenticationProvider" />
  </list>
  </property>
  </bean>
   
  
  <bean id="ldapAuthenticationProvider"
  class="org.acegisecurity.providers.ldap.LdapAuthenticationProvider">
  
  <constructor-arg>
  <ref local="authenticator" />
  </constructor-arg>
  
  <constructor-arg>
  <ref local="customPopulator" />
  </constructor-arg>
  
  </bean>
   
  
  <bean id="authenticator"
  
class="org.acegisecurity.providers.ldap.authenticator.PasswordComparisonAuthenticator">
  
  <constructor-arg>
  <ref local="initialDirContextFactory" />
  </constructor-arg>
  
  <property name="userDnPatterns">
  <list>
  <value>uid={0},ou=Management</value>
  <value>uid={0},ou=Accounting</value>
  <value>uid={0},ou=Planning</value>
  <value>uid={0},ou=Human Resources</value>
  <value>uid={0},ou=Administrative</value>
  <value>uid={0},ou=Janitorial</value>
  <value>uid={0},ou=Payroll</value>
  <value>uid={0},ou=Peons</value>
  <value>uid={0},ou=Product Development</value>
  <value>uid={0},ou=Product Testing</value>
  </list>
  </property>
  
  <property name="userSearch">
  <ref local="userSearch" />
  </property>
  
  <property name="passwordAttributeName" value="userPassword"></property>
  
  <property name="passwordEncoder">
  <bean class="org.acegisecurity.providers.encoding.PlaintextPasswordEncoder">
  </bean>
  </property>
  
  </bean>
   
  
  <bean id="initialDirContextFactory"
  class="org.acegisecurity.ldap.DefaultInitialDirContextFactory">
  <constructor-arg
  value="ldap://localhost:389/"; />
  
  <property name="managerDn">
  <value>o=sgi,c=us</value>
  </property>
  
  <property name="managerPassword">
  <value>secret</value>
  </property>
  
  </bean>
   
  
  
  <bean id="userSearch"
  class="org.acegisecurity.ldap.search.FilterBasedLdapUserSearch">
  <constructor-arg>
  <value>o=sgi,c=us</value>
  </constructor-arg>
  
  <constructor-arg>
  <value>(uid={0})</value>
  </constructor-arg>
  
  <constructor-arg>
  <ref local="initialDirContextFactory" />
  </constructor-arg>
  
  <property name="searchSubtree">
  <value>true</value>
  </property>
  
  </bean>
   
  
  <bean id="customPopulator"
  
class="com.ABCCompany.security.authentication.ldap.CustomDefaultLdapAuthoritiesPopulator">
  
  <constructor-arg>
  <ref local="initialDirContextFactory" />
  </constructor-arg>
  <!-- group search base -->
  <constructor-arg>
  <value></value>
  </constructor-arg>
  
  <property name="groupRoleAttribute">
  <value>ou</value>
  </property>
  
  <property name="searchSubtree">
  <value>true</value>
  </property>
  
  </bean>
   
  thanks
  Djeneba


Djeneba(Jeneba) Traore
SimonComputing, Inc.
Tel. 703-914-5454 Ext. 103
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Home: http://acegisecurity.org
Acegisecurity-developer mailing list
Acegisecurity-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer

Reply via email to