0 Replies Latest reply on Nov 27, 2014 2:09 PM by massimo amato

    wildfly 8.2 login-module

    massimo amato Newbie

      hi,

      i've an application running on wildfly 8.0 with database login module configured

      now i've downloaded 8.2, modified the standalone.xml but i'm unable to login

      the ear is the same and also the database

      i've experienced the same problem also with 8.1 so i didn't upgrade

      any ideas ?

       

      standalone.xml

       

                      <security-domain name="mabRealm" cache-type="default">

                          <authentication>

                              <login-module code="Database" flag="sufficient">

                                  <module-option name="dsJndiName" value="java:jboss/datasources/mabCore"/>

                                  <module-option name="principalsQuery" value="SELECT password FROM TB_Utente WHERE nome = ?"/>

                                  <module-option name="rolesQuery" value="SELECT TB_Ruolo.nome Role, 'Roles' Roles FROM TB_Utente JOIN TB_RuoliUtenti ON TB_Utente.nome = TB_RuoliUtenti.nomeUtente JOIN TB_Ruolo ON TB_Ruolo.nome = TB_RuoliUtenti.nomeRuolo WHERE TB_Utente.nome = ?"/>

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

                                  <module-option name="hashEncoding" value="hex"/>

                              </login-module>

                          </authentication>

                      </security-domain>

       

       

      web.xml

       

      <security-constraint>

        <web-resource-collection>

        <web-resource-name>Cruscotto resources</web-resource-name>

        <description>Protects all cruscotto resources</description>

        <url-pattern>/cruscotto/*</url-pattern>

        </web-resource-collection>

        <auth-constraint>

        <role-name>ADMIN</role-name>

        <role-name>WRITE</role-name>

        <role-name>VIEW</role-name>

        </auth-constraint>

      </security-constraint>

       

      <security-role>

        <role-name>ADMIN</role-name>

      </security-role>

      <security-role>

        <role-name>WRITE</role-name>

      </security-role>

      <security-role>

        <role-name>VIEW</role-name>

      </security-role>

       

      <login-config>

        <auth-method>FORM</auth-method>

        <form-login-config>

        <form-login-page>/login.faces</form-login-page>

        <form-error-page>/login.faces</form-error-page>

        </form-login-config>

      </login-config>

       

      jboss-web.xml

       

      <!DOCTYPE jboss-web PUBLIC

         "-//JBoss//DTD Web Application 5.0//EN"

         "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">

        

      <jboss-web>

         <!-- Uncomment the security-domain to enable security. You will

            need to edit the htmladaptor login configuration to setup the

            login modules used to authentication users.

         -->

            <security-domain>mabRealm</security-domain>

      </jboss-web>



      log


      2014-11-27 19:54:06,356 TRACE [org.jboss.security] (default task-2) PBOX000354: Setting security roles ThreadLocal: null

      2014-11-27 19:54:11,559 TRACE [org.jboss.security] (default task-3) PBOX000200: Begin isValid, principal: org.wildfly.extension.undertow.security.AccountImpl$AccountPrincipal@1a57d, cache entry: null

      2014-11-27 19:54:11,560 TRACE [org.jboss.security] (default task-3) PBOX000209: defaultLogin, principal: org.wildfly.extension.undertow.security.AccountImpl$AccountPrincipal@1a57d

      2014-11-27 19:54:11,562 TRACE [org.jboss.security] (default task-3) PBOX000221: Begin getAppConfigurationEntry(mabRealm), size: 4

      2014-11-27 19:54:11,568 TRACE [org.jboss.security] (default task-3) PBOX000224: End getAppConfigurationEntry(mabRealm), AuthInfo: AppConfigurationEntry[]:

      [0]

      LoginModule Class: org.jboss.security.auth.spi.DatabaseServerLoginModule

      ControlFlag: LoginModuleControlFlag: sufficient

      Options:

      name=hashAlgorithm, value=SHA-256

      name=principalsQuery, value=SELECT password FROM TB_Utente WHERE nome = ?

      name=hashEncoding, value=hex

      name=dsJndiName, value=java:jboss/datasources/mabCore

      name=rolesQuery, value=SELECT TB_Ruolo.nome Role, 'Roles' Roles FROM TB_Utente JOIN TB_RuoliUtenti ON TB_Utente.nome = TB_RuoliUtenti.nomeUtente JOIN TB_Ruolo ON TB_Ruolo.nome = TB_RuoliUtenti.nomeRuolo WHERE TB_Utente.nome = ?

       

       

      2014-11-27 19:54:11,576 TRACE [org.jboss.security] (default task-3) PBOX000236: Begin initialize method

      2014-11-27 19:54:11,576 DEBUG [org.jboss.security] (default task-3) PBOX000281: Password hashing activated, algorithm: SHA-256, encoding: hex, charset: null, callback: null, storeCallBack: null

      2014-11-27 19:54:11,577 TRACE [org.jboss.security] (default task-3) PBOX000262: Module options [dsJndiName: java:jboss/datasources/mabCore, principalsQuery: SELECT password FROM TB_Utente WHERE nome = ?, rolesQuery: SELECT TB_Ruolo.nome Role, 'Roles' Roles FROM TB_Utente JOIN TB_RuoliUtenti ON TB_Utente.nome = TB_RuoliUtenti.nomeUtente JOIN TB_Ruolo ON TB_Ruolo.nome = TB_RuoliUtenti.nomeRuolo WHERE TB_Utente.nome = ?, suspendResume: true]

      2014-11-27 19:54:11,577 TRACE [org.jboss.security] (default task-3) PBOX000240: Begin login method

      2014-11-27 19:54:11,591 TRACE [org.jboss.security] (default task-3) PBOX000263: Executing query SELECT password FROM TB_Utente WHERE nome = ? with username mbr

      2014-11-27 19:54:11,594 TRACE [org.jboss.security] (default task-3) PBOX000241: End login method, isValid: true

      2014-11-27 19:54:11,595 TRACE [org.jboss.security] (default task-3) PBOX000242: Begin commit method, overall result: true

      2014-11-27 19:54:11,595 TRACE [org.jboss.security] (default task-3) PBOX000263: Executing query SELECT TB_Ruolo.nome Role, 'Roles' Roles FROM TB_Utente JOIN TB_RuoliUtenti ON TB_Utente.nome = TB_RuoliUtenti.nomeUtente JOIN TB_Ruolo ON TB_Ruolo.nome = TB_RuoliUtenti.nomeRuolo WHERE TB_Utente.nome = ? with username mbr

      2014-11-27 19:54:11,597 TRACE [org.jboss.security] (default task-3) PBOX000263: Executing query SELECT TB_Ruolo.nome Role, 'Roles' Roles FROM TB_Utente JOIN TB_RuoliUtenti ON TB_Utente.nome = TB_RuoliUtenti.nomeUtente JOIN TB_Ruolo ON TB_Ruolo.nome = TB_RuoliUtenti.nomeRuolo WHERE TB_Utente.nome = ? with username mbr

      2014-11-27 19:54:11,603 TRACE [org.jboss.security] (default task-3) PBOX000210: defaultLogin, login context: javax.security.auth.login.LoginContext@15129f5, subject: Subject(991638).principals=org.jboss.security.SimplePrincipal@12753548(mbr)org.jboss.security.SimpleGroup@149105515(Roles(members:VIEW,WRITE))org.jboss.security.SimpleGroup@149105515(CallerPrincipal(members:mbr))

      2014-11-27 19:54:11,605 TRACE [org.jboss.security] (default task-3) PBOX000207: updateCache, input subject: Subject(991638).principals=org.jboss.security.SimplePrincipal@12753548(mbr)org.jboss.security.SimpleGroup@149105515(Roles(members:VIEW,WRITE))org.jboss.security.SimpleGroup@149105515(CallerPrincipal(members:mbr)), cached subject: Subject(521774403).principals=org.jboss.security.SimplePrincipal@12753548(mbr)org.jboss.security.SimpleGroup@149105515(Roles(members:VIEW,WRITE))org.jboss.security.SimpleGroup@149105515(CallerPrincipal(members:mbr))

      2014-11-27 19:54:11,605 TRACE [org.jboss.security] (default task-3) PBOX000208: Inserted cache info: org.jboss.security.authentication.JBossCachedAuthenticationManager$DomainInfo@4cb0e1a8

      2014-11-27 19:54:11,607 TRACE [org.jboss.security] (default task-3) PBOX000201: End isValid, result = true

      2014-11-27 19:54:11,624 TRACE [org.jboss.security] (default task-3) PBOX000354: Setting security roles ThreadLocal: null