0 Replies Latest reply on Jan 15, 2003 7:13 AM by Caroline Augustin

    javax.naming.CommunicationException: localhost:636

    Caroline Augustin Newbie

      I want to use LdapLoginModule.

      I configured it in login-config.xml:

      <application-policy name="ldap">

      <login-module code="org.jboss.security.auth.spi.LdapLoginModule" flag="required">
      <module-option name = "java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</module-option>
      <module-option name = "java.naming.provider.url">ldap://xxx:389/</module-option>
      <module-option name = "java.naming.security.authentication">simple</module-option>
      <module-option name = "principleDNPrefix">uid=</module-option>
      <module-option name = "principleDNSuffix">ou=people,dc=xxx,dc=xxx</module-option>

      <module-option name = "uidAttributeID">uid=</module-option>
      <module-option name = "roleAttributeID">cn=</module-option>
      </login-module>

      </application-policy>

      I put an entry to auth.conf:

      ldap {
      org.jboss.security.auth.spi.LdapLoginModule required;
      };

      Now when I attempt to login via my TestClient I become this exception:
      javax.naming.CommunicationException: localhost:636. Root exception is
      java.net.ConnectException: Connection refused: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
      at java.net.Socket.(Socket.java:273)
      at java.net.Socket.(Socket.java:100)
      at com.sun.jndi.ldap.Connection.(Connection.java:203)
      at com.sun.jndi.ldap.LdapClient.(LdapClient.java:113)
      at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2384)
      at com.sun.jndi.ldap.LdapCtx.(LdapCtx.java:244)
      at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.jav
      a:79)
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
      65)
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246
      )
      at javax.naming.InitialContext.init(InitialContext.java:222)
      at javax.naming.ldap.InitialLdapContext.(InitialLdapContext.java:1
      33)
      at org.jboss.security.auth.spi.LdapLoginModule.createLdapInitContext(Lda
      pLoginModule.java:239)
      at org.jboss.security.auth.spi.LdapLoginModule.validatePassword(LdapLogi
      nModule.java:189)
      at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(Usernam
      ePasswordLoginModule.java:144)
      at java.lang.reflect.Method.invoke(Native Method)
      at javax.security.auth.login.LoginContext.invoke(LoginContext.java:664)
      at javax.security.auth.login.LoginContext.access$000(LoginContext.java:1
      29)
      at javax.security.auth.login.LoginContext$4.run(LoginContext.java:599)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java
      :596)
      at javax.security.auth.login.LoginContext.login(LoginContext.java:523)

      My question: Is localhost:636 a default setting? I did not find it anywhere. Has it to do with SSL? May be I just have forgotten to set a configuration value and this is default?

      thx