3 Replies Latest reply on Oct 17, 2006 11:45 PM by ra ra

    can't do loging to Authorized pages using JAAS

    ra ra Newbie

      hi all
      i have problem using jaas the login/password popup window apear but when im trying to enter the username and password nothing happen

      web.xml
      -----------

      <security-constraint>
      <web-resource-collection>
      <web-resource-name>Secure Content</web-resource-name>
      <url-pattern>/*</url-pattern>
      </web-resource-collection>

      <auth-constraint>
      <role-name>AuthorizedUser</role-name>
      </auth-constraint>

      </security-constraint>

      <login-config>
      <auth-method>BASIC</auth-method>
      <realm-name>AuthorizedUser</realm-name>
      </login-config>

      <security-role>
      The role required to access restricted content
      <role-name>AuthorizedUser</role-name>



      mysql-ds.xml
      ----------------------

      <local-tx-datasource>
      <jndi-name>MySqlDS</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/authority</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>root</user-name>
      root
      </local-tx-datasource>





      login-config.xml
      ----------------------

      <application-policy name="myOwnDomain">

      <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule\"
      flag="required">
      <module-option name="dsJndiName">java:MySqlDS</module-option>
      <module-option name="principalsQuery">
      select Password from users where userID=?</module-option>
      <module-option name="rolesQuery">
      select Role,'Roles' from Roles where userID=?</module-option>
      </login-module>

      </application-policy>




      is there a way i can debug what the query return?
      how can i make sure jboss succefully conncted to mysql?