3 Replies Latest reply on Oct 2, 2015 6:05 AM by Martin Choma

    JAAS login fails for web application at midnight in wildfly every day, works only after wildfly is reloaded or restarte

    sitaram c Newbie

       

       

       

      I have enabled JAAS(Form based authentication) for my web application which is in WildFly server. JAAS is working and I am able to login to my web site with username and password. But, the login fails at mid night every night. So, I have set up a crontab to reload wildfly at midnight. As of now it is OK as we are in testing phase and four to five users use it. If many users use the application and then reload occurs , will reload disturbs the transaction or working of the application.

      WHY MY JAAS FAILS AT MIGNIGHT ? I have searched all over but could not find even any one specifying such a problem. Please help me in clearing this problem

      jbossweb.xml

      <jboss-web>

      <security-domain>prometheus-domain</security-domain>

      </jboss-web>

      Datasource

      <datasource jta="false" jndi-name="java:jboss/datasources/prometheus1" pool-name="java:jboss/datasources/prometheus1_Pool" enabled="true" use-java-context="true" use-ccm="true">

      <connection-url>jdbc:mysql://URL/prometheus_test</connection-url>

      <driver-class>com.mysql.jdbc.Driver</driver-class>

      <driver>mysql-connector-java-5.1.35-bin.jar_com.mysql.jdbc.Driver_5_1</driver>

      <security>

      <user-name>username</user-name>

      <password>password</password>

      </security>

      <validation>

      <validate-on-match>false</validate-on-match>

      <background-validation>false</background-validation>

      </validation>

      <timeout>

      <set-tx-query-timeout>false</set-tx-query-timeout>

      <blocking-timeout-millis>0</blocking-timeout-millis>

      <idle-timeout-minutes>0</idle-timeout-minutes>

      <query-timeout>0</query-timeout>

      <use-try-lock>0</use-try-lock>

      <allocation-retry>0</allocation-retry>

      <allocation-retry-wait-millis>0</allocation-retry-wait-millis>

      </timeout>

      <statement>

      <share-prepared-statements>true</share-prepared-statements>

      </statement>

      </datasource>


      Security Domain

      <security-domain name="prometheus-domain" >

      <authentication>

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

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

      <module-option name="principalsQuery" value="select password from users where email=?"/>

      <module-option name="rolesQuery" value="select role_id 'RoleId', role 'Roles' from user_roles where role_id=(select role_id from users where email=?)"/>

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

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

      </login-module>

      </authentication>

      </security-domain>