1 Reply Latest reply on Aug 5, 2003 10:39 PM by benkarsa

    DatabaseServerLoginModule

    basicnoob

      hi i'm new at this, but even after following all instructions i could find, i can't get it to work.
      i'm trying to set up an database login, using form base login method, so if anyone could point me in any direction, i'll would be very happy.
      this is my login-config.xml <application-policy name = "other2">

      <login-module code ="org.jboss.security.auth.spi.DatabaseServerLoginModule"
      flag = "required">
      <module-option name = "dsJndiName">java:/default</module-option>
      <module-option name = "principalsQuery">select Password from Principals where PrincipalID=?</module-option>
      <module-option name = "rolesQuery">select Role from Roles where PrincipalID=?</module-option>
      </login-module>

      </application-policy>

      and heres my jboss-web.xml

      <jboss-web>
      <security-domain>java:/jaas/other2</security-domain>
      </jboss-web>

      and my web.xml

      <security-constraint>
      <web-resource-collection>
      <web-resource-name>Admin pages</web-resource-name>
      <url-pattern>/admin/*</url-pattern>
      <http-method>GET</http-method>
      <http-method>POST</http-method>
      </web-resource-collection>
      <auth-constraint>
      <role-name>admin</role-name>
      </auth-constraint>
      </security-constraint>

      <login-config>
      <auth-method>FORM</auth-method>
      <form-login-config>
      <form-login-page>/logon.jsp</form-login-page>
      <form-error-page>/logonFailed.jsp</form-error-page>
      </form-login-config>
      </login-config>

      <security-role>
      <role-name>admin</role-name>
      </security-role>

      i have set up an hypersonic data base "default"
      white the user/password admin/admin and role admin
      so that is not the problem i think
      i'm using jboss 3.2.1 and windows xp-pro
      i really need help /thanks



        • 1. Re: DatabaseServerLoginModule
          benkarsa

          Hi basicnoob,

          there's an error in your login-config.xml. The rolesQuery have to look like this:

          <module-option name = "rolesQuery">select Role, 'Roles' from Roles where PrincipalID=?</module-option>

          There's a second constant value 'Roles'. This is the only value JBoss excepts.