1 Reply Latest reply on Aug 7, 2011 3:40 AM by sureshbabu C

    Using databaseloginmodule with GateIn portal + jboss 5

    sureshbabu C Newbie

      Hi,

       

      I am new to Jboss &  trying to use the databaseloginmodule with the Gatein portal 3.1 GA + jboss 5.1.0 GA for user login.I have configured the JNDI & also configured login-config.xml with the below entries.

       

      <application-policy name = "myjaasapp">

      <authentication>

      <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required">

      <module-option name = "dsJndiName">java:/mysqljndi</module-option>

      <module-option name = "principalsQuery">select 'text' from jbid_io_creden a,jbid_io b where a.IDENTITY_OBJECT_ID=b.ID and b.NAME=?</module-option>

      <!-- <module-option name = "rolesQuery">Select 'user', 'Roles', 'RoleGroups' from user_table where user_name =?</module-option> -->

      <module-option name ="hashAlgorithm">SHA-256</module-option>

      <module-option name="hashEncoding">base64</module-option>

      <module-option name="debug">true</module-option>

      </login-module>

      <login-module code="org.jboss.security.ClientLoginModule" flag="required" />

      </authentication>

      </application-policy>

       

      Initially I just wanted to ensure the authendication  is happening correctly.But always authentication failing because of Bad password error.Below is my TRACE logs.

       

      2011-07-30 23:30:12,601 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] (http-127.0.0.1-8180-1) initialize

      2011-07-30 23:30:12,601 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] (http-127.0.0.1-8180-1) Security domain: myjaasapp

      2011-07-30 23:30:12,602 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] (http-127.0.0.1-8180-1) Password hashing activated: algorithm = SHA-256, encoding = base64, charset = {default}, callback = null, storeCallback = null

      2011-07-30 23:30:12,602 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] (http-127.0.0.1-8180-1) DatabaseServerLoginModule, dsJndiName=java:/mysqljndi

      2011-07-30 23:30:12,602 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] (http-127.0.0.1-8180-1) principalsQuery=select 'text' from jbid_io_creden a,jbid_io b where a.IDENTITY_OBJECT_ID=b.ID and b.NAME=?

      2011-07-30 23:30:12,602 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] (http-127.0.0.1-8180-1) suspendResume=true

      2011-07-30 23:30:12,607 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] (http-127.0.0.1-8180-1) login

      2011-07-30 23:30:12,620 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] (http-127.0.0.1-8180-1) suspendAnyTransaction

      2011-07-30 23:30:12,653 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] (http-127.0.0.1-8180-1) Excuting query: select 'text' from jbid_io_creden a,jbid_io b where a.IDENTITY_OBJECT_ID=b.ID and b.NAME=?, with username: sureshbabuc

      2011-07-30 23:30:12,655 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] (http-127.0.0.1-8180-1) Obtained user password

      2011-07-30 23:30:12,655 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] (http-127.0.0.1-8180-1) resumeAnyTransaction

      2011-07-30 23:30:12,656 DEBUG [org.jboss.security.auth.spi.DatabaseServerLoginModule] (http-127.0.0.1-8180-1) Bad password for username=sureshbabuc

      2011-07-30 23:30:12,661 TRACE [org.jboss.security.ClientLoginModule] (http-127.0.0.1-8180-1) Security domain: myjaasapp

      2011-07-30 23:30:12,661 TRACE [org.jboss.security.ClientLoginModule] (http-127.0.0.1-8180-1) Enabling restore-login-identity mode

      2011-07-30 23:30:12,662 TRACE [org.jboss.security.ClientLoginModule] (http-127.0.0.1-8180-1) Begin login

      2011-07-30 23:30:12,662 TRACE [org.jboss.security.ClientLoginModule] (http-127.0.0.1-8180-1) Obtained login: sureshbabuc, credential.class: [C

      2011-07-30 23:30:12,662 TRACE [org.jboss.security.ClientLoginModule] (http-127.0.0.1-8180-1) End login

      2011-07-30 23:30:12,662 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] (http-127.0.0.1-8180-1) abort

      2011-07-30 23:30:12,662 TRACE [org.jboss.security.ClientLoginModule] (http-127.0.0.1-8180-1) abort

      2011-07-30 23:30:12,672 TRACE [org.jboss.security.plugins.auth.JaasSecurityManagerBase.myjaasapp] (http-127.0.0.1-8180-1) Login failure

      javax.security.auth.login.FailedLoginException: Password Incorrect/Password Required

                at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:252)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

       

      I am not sure databaseloginmodule will work with Gatein portal or not .If it works , am i doing anything wrong ?

      Please help me