Announcement Announcement Module
Collapse
No announcement yet.
Spring and Ldap: socket closed error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring and Ldap: socket closed error

    Hi,

    We're getting this error at login:

    Reason: myldapserver.com:389; socket closed; nested exception is javax.naming.ServiceUnavailableException: myldapserver.com:389; socket closed; remaining name '/'.

    This is our applicationContext-Security.xml configuration:

    Code:
    <s:authentication-manager alias="authenticationManager">
      <s:authentication-provider ref="ldapActiveDirectoryAuthProvider" />
    </s:authentication-manager>
     
    <bean id="contextSource" class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">
      <constructor-arg value="ldap://myldapserver.com:389/DC=americas,DC=XYZ,DC=LOCAL"/>
      <property name="userDn" value="${portal.ldap.user}"/>
      <property name="password" value="${portal.ldap.password}"/>
      <property name="baseEnvironmentProperties">
         <map>
            <entry key="com.sun.jndi.ldap.connect.timeout" value="0" />
            <entry key="java.naming.referral">
                <value>follow</value>
            </entry>
         </map>
      </property>
    </bean>
     
    <bean id="userSearch" class="org.springframework.security.ldap.search.FilterBasedLdapUserSearch">
      <constructor-arg index="0" value="" />
      <constructor-arg index="1" value="sAMAccountName={0}" />
      <constructor-arg index="2" ref="contextSource" />
    </bean>
    
    <bean id="ldapActiveDirectoryAuthProvider" class="org.springframework.security.ldap.authentication.LdapAuthenticationProvider">
      <constructor-arg>
        <bean class="org.springframework.security.ldap.authentication.BindAuthenticator">
          <constructor-arg ref="contextSource"/>
          <property name="userSearch" ref="userSearch"/>
        </bean>
      </constructor-arg>
    </bean>
    We added the "timeout" as a recommendation found online to try to fix the socket closed issue but it didn't work.

    Any help will be greatly appreciated.
Working...
X