So I have been experimenting with this JDBCRealm stuff and can't seem to make it ask me for a user name and password.
 
in the server.xml is..
<RequestInterceptor className="org.apache.tomcat.request.JDBCRealm" debug="99" 
driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://localhost/authority?user=authcheck;password=passcheck"
userTable="Users" userNameCol="UserName" userCredCol="PassWord"
userRoleTable="UserRoles" roleNameCol="RoleName" />
 
in the examples web.xml is...
<security-constraint>
      <web-resource-collection>
         <web-resource-name>Protected Area</web-resource-name>
  <!-- Define the context-relative URL(s) to be protected -->
         <url-pattern>/examples/servlets/*</url-pattern>
  <!-- If you list http methods, only those methods are protected -->
  <http-method>DELETE</http-method>
         <http-method>GET</http-method>
         <http-method>POST</http-method>
  <http-method>PUT</http-method>
      </web-resource-collection>
      <auth-constraint>
         <!-- Anyone with one of the listed roles may access this area -->
         <role-name>tomcat</role-name>
  <role-name>role1</role-name>
      </auth-constraint>
    </security-constraint>
 
    <!-- Default login configuration uses BASIC authentication -->
    <login-config>
      <auth-method>BASIC</auth-method>
      <realm-name>Example Basic Authentication Area</realm-name>
    </login-config>
 
Shouldn't all this require the server to ask me for a password before I can use any of my servlets or am I missing something here?

Reply via email to