1 Reply Latest reply on Apr 24, 2014 8:19 AM by Felipe Vinturini

    Database login-module

    Ja kub Novice
      Could someone please send full standalone.xml for eap 6.2, or it's vital parts.



      I want to configure basic web.xml auth with database realm, but I always finish with error.
      Is there a difference in configuration between jboss 7.1 and jboss 7.3 and eap 6.2 ?


      In <subsystem xmlns="urn:jboss:domain:security:1.2">


      I added


                      <security-domain name="mysqldomain" cache-type="default">
                              <login-module code="Database" flag="required">
                                  <module-option name="dsJndiName" value="java:jboss/datasources/petclinicDS"/>
                                   <module-option name="principalsQuery" value="select passwd from USERS where login=?"/>
                                  <module-option name="rolesQuery" value="select role 'Roles' from USER_ROLES where login=?"/>


      database java:jboss/datasources/petclinicDS is ok, it is used in petclinic app and works.

      and in jboss-web.xml:


      also tried with <security-domain>mysqldomain</security-domain>

      and in web.xml:

      <?xml version="1.0" encoding="UTF-8"?>

      <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"












          <realm-name>Sample Realm</realm-name>








        • 1. Re: Database login-module
          Felipe Vinturini Newbie



          As you did not post the error you faced, I am going to put some suggestions for you to check:


          In your standalone.xml, improve: org.jboss.security log messages:

          <subsystem xmlns="urn:jboss:domain:logging:1.3">
               <logger category="org.jboss.security">
                    <level name="TRACE"/>

          Restart JBoss and check server.log file for messages.


          Try to add the realm in the standalone.xml:

                    <security-realm name="mysqldomain">
                              <jaas name="mysqldomain"/>


          In your: jboss-web.xml, change the security-domain to:



          I hope it helps you to solve your problem.