vendredi 26 juin 2015

Why Data base modifications not affecting the data source in WildFly 8.2.0?

I have configured JAAS(Form based authentication) for my WildFly server. JAAS is working and I am able to login to my web site with username and password. But If I add new user record to data base, which configured in data source, I am not able to login with that new user. If I delete the datasource and add it agian, I can login with newly added user and old user as well. The data source is not affecting the changes in data base(like adding new user record). here is my code which is configured in WildFly standalone.xml file . please help me.

Data Source

<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" cache-type="default">
                <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>

Aucun commentaire:

Enregistrer un commentaire