0 Replies Latest reply on Jan 27, 2004 2:19 AM by jmartin_hc

    Problem with application-policy and Oracle

    jmartin_hc

      Hi:

      I am writing an application using jboss and ejb. This application have defined 3 roles an all operation in ejb use some of this roles.

      In the jboss.xml file I have the security-domain, and in the loggin-config.xml I have a application policy with Its principalsQuery and rolesQuery.

      I have a problem when I am using Oracle data base. The problem happens when the container try to find the rol using the sql rolesQuery, always It say me 'the interfaz Home need role=[XXXXX, YYYY], role=null'. Nevertheless the authentication (validate user/password) run ok.

      My application policy is like this:

      <application-policy name = "myApplicationPolicy">

      <login-module code="org.jboss.security.ClientLoginModule" flag="required" />
      <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
      <module-option name="dsJndiName">java:MyConnectionDS</module-option>
      <module-option name="principalsQuery">SELECT PASSWORD FROM USERS WHERE USER=?</module-option>
      <module-option name="rolesQuery">SELECT ROLE, ROLEGROUP FROM ROLES WHERE USER=?</module-option>
      </login-module>

      </application-policy>

      It is happening to me with Oracle, because I tried another example with MySql and It run ok.

      Please, if somebody know something write me, Thank