3 Replies Latest reply on Jan 7, 2010 5:12 PM by vid sha

    [JBoss 6.0 M1] javax.security.auth.login.FailedLoginException: Password Incorrect/Password Required

    Celinio Fernandes Novice

      Hi,
      Happy new year.

      I have a problem when i try to log on a LDAP server through some Java code, using the LdapExtLoginModule login module in JBoss 6.O M1.

      Here is my login-config.xml file :

       

      1. <application-policy name="venteEnLigne_domaine_LDAP"
      2.          <authentication> 
      3.              <login-module code="org.jboss.security.auth.spi.LdapExtLoginModule" flag="required"
      4.                  <module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</module-option> 
      5.                  <module-option name="java.naming.provider.url">ldap://localhost:10389</module-option> 
      6.                  <module-option name="java.naming.security.authentication">simple</module-option> 
      7.                  <module-option name="bindDN">uid=admin,ou=system</module-option> 
      8.                  <module-option name="bindCredential">secret</module-option> 
      9.                   <module-option name="baseCtxDN">ou=users,ou=system</module-option> 
      10.                               <module-option name="baseFilter">(sAMAccountName={0})</module-option> 
      11.                                   <module-option name="roleFilter">(member={1})</module-option> 
      12.                  <module-option name="searchScope">ONELEVEL_SCOPE</module-option> 
      13.                  <module-option name="allowEmptyPasswords">false</module-option> 
      14.            </login-module> 
      15.          </authentication> 
      16.      </application-policy> 

       

      Here is my Java code to connect to the LDAP server :

       

      1. SecurityClient securityClient; 
      2. securityClient = SecurityClientFactory.getSecurityClient(); 
      3. securityClient.setSimple("log6", "pwd6");    
      4. securityClient.login(); 

       

       

      Here is the log of the server when i start it :

       

      1. etAppConfigurationEntry(venteEnLigne_domaine_LDAP), authInfo=AppConfigurationEntry[]: 
      2. [0
      3. LoginModule Class: org.jboss.security.auth.spi.LdapExtLoginModule 
      4. ControlFlag: LoginModuleControlFlag : required 
      5. Options: 
      6. name=baseFilter, value=(sAMAccountName={0}) 
      7. name=java.naming.security.authentication, value=simple 
      8. name=java.naming.factory.initial, value=com.sun.jndi.ldap.LdapCtxFactory 
      9. name=allowEmptyPasswords, value=false 
      10. name=roleFilter, value=(member={1}) 
      11. name=bindCredential, value=**** 
      12. name=bindDN, value=uid=admin,ou=system 
      13. name=java.naming.provider.url, value=ldap://localhost:10389 
      14. name=baseCtxDN, value=ou=users,ou=system 
      15. name=searchScope, value=ONELEVEL_SCOPE 

       

      And here is the log when i attempt to connect with the previous Java code :

       

      1. 2010-01-01 13:13:56,714 TRACE [org.jboss.security.auth.spi.LdapExtLoginModule] (WorkerThread#0[127.0.0.1:51632]) initialize 
      2. 2010-01-01 13:13:56,714 TRACE [org.jboss.security.auth.spi.LdapExtLoginModule] (WorkerThread#0[127.0.0.1:51632]) Security domain: venteEnLigne_domaine_LDAP 
      3. 2010-01-01 13:13:56,714 TRACE [org.jboss.security.auth.spi.LdapExtLoginModule] (WorkerThread#0[127.0.0.1:51632]) login 
      4. 2010-01-01 13:13:56,714 TRACE [org.jboss.security.auth.spi.LdapExtLoginModule] (WorkerThread#0[127.0.0.1:51632]) Authenticating as unauthenticatedIdentity=null 
      5. 2010-01-01 13:13:56,714 DEBUG [org.jboss.security.auth.spi.LdapExtLoginModule] (WorkerThread#0[127.0.0.1:51632]) Bad password for username=null 
      6. 2010-01-01 13:13:56,715 TRACE [org.jboss.security.auth.spi.LdapExtLoginModule] (WorkerThread#0[127.0.0.1:51632]) abort 
      7. 2010-01-01 13:13:56,715 TRACE [org.jboss.security.plugins.auth.JaasSecurityManagerBase.venteEnLigne_domaine_LDAP] (WorkerThread#0[127.0.0.1:51632]) Login failure 
      8. javax.security.auth.login.FailedLoginException: Password Incorrect/Password Required 
      9.     at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:252
      10.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
      11.     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
      12.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
      13.     at java.lang.reflect.Method.invoke(Unknown Source) 
      14.     at javax.security.auth.login.LoginContext.invoke(Unknown Source) 
      15.     at javax.security.auth.login.LoginContext.access$000(Unknown Source) 
      16.     at javax.security.auth.login.LoginContext$4.run(Unknown Source) 
      17.     at java.security.AccessController.doPrivileged(Native Method) 
      18.     at javax.security.auth.login.LoginContext.invokePriv(Unknown Source) 
      19.     at javax.security.auth.login.LoginContext.login(Unknown Source) 
      20.     at org.jboss.security.plugins.auth.JaasSecurityManagerBase.defaultLogin(JaasSecurityManagerBase.java:553
      21.     at org.jboss.security.plugins.auth.JaasSecurityManagerBase.authenticate(JaasSecurityManagerBase.java:487
      22.     at org.jboss.security.plugins.auth.JaasSecurityManagerBase.isValid(JaasSecurityManagerBase.java:365
      23.     at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:160
      24.     at org.jboss.security.javaee.EJBAuthenticationHelper.isValid(EJBAuthenticationHelper.java:87
      25.     at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:164
      26.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102
      27.     at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41
      28.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102
      29.     at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67
      30.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102
      31.     at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67
      32.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102
      33.     at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86
      34.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102
      35.     at org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulContainer.java:567
      36.     at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53
      37.     at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91
      38.     at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82
      39.     at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:897
      40.     at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:768
      41.     at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:721
      42.     at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548
      43.     at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234
      44. 2010-01-01 13:13:56,715 TRACE [org.jboss.security.plugins.auth.JaasSecurityManagerBase.venteEnLigne_domaine_LDAP] (WorkerThread#0[127.0.0.1:51632]) End isValid, false 
      45. 2010-01-01 13:13:56,719 TRACE [org.jboss.security.audit.providers.LogAuditProvider] (WorkerThread#0[127.0.0.1:51632]) [Error]Source=org.jboss.security.javaee.EJBAuthenticationHelper;principal=null;method=sauver; 
      46. javax.security.auth.login.FailedLoginException: Password Incorrect/Password Required 
      47.     at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:252
      48.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
      49.     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
      50.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
      51.     at java.lang.reflect.Method.invoke(Unknown Source) 
      52.     at javax.security.auth.login.LoginContext.invoke(Unknown Source) 
      53.     at javax.security.auth.login.LoginContext.access$000(Unknown Source) 
      54.     at javax.security.auth.login.LoginContext$4.run(Unknown Source) 
      55.     at java.security.AccessController.doPrivileged(Native Method) 
      56.     at javax.security.auth.login.LoginContext.invokePriv(Unknown Source) 
      57.     at javax.security.auth.login.LoginContext.login(Unknown Source) 
      58.     at org.jboss.security.plugins.auth.JaasSecurityManagerBase.defaultLogin(JaasSecurityManagerBase.java:553
      59.     at org.jboss.security.plugins.auth.JaasSecurityManagerBase.authenticate(JaasSecurityManagerBase.java:487
      60.     at org.jboss.security.plugins.auth.JaasSecurityManagerBase.isValid(JaasSecurityManagerBase.java:365
      61.     at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:160
      62.     at org.jboss.security.javaee.EJBAuthenticationHelper.isValid(EJBAuthenticationHelper.java:87
      63.     at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:164
      64.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102
      65.     at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41
      66.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102
      67.     at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67
      68.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102
      69.     at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67
      70.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102
      71.     at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86
      72.     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102
      73.     at org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulContainer.java:567
      74.     at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53
      75.     at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91
      76.     at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82
      77.     at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:897
      78.     at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:768
      79.     at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:721
      80.     at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548
      81.     at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234

       

       

      That's very strange because i can connect with that use using

      DirContext context = new InitialDirContext(env);  // env is an Hashmap with the correct options

       

       

      How come it ignores the password, says it's incorrect / missing ?

      Thanks for helping.