[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

tomcat 4.0.1 jdbc realm user-role question

hi all,

how do i set tomcat not to look for a role when validating a user using jdbcrealm? if i omit the
<auth-constraint> it wont' validate anything it will just forward you to the resouce.

thanks.

    <security-constraint>
     
     <web-resource-collection>
         <web-resource-name>User Protected Area</web-resource-name>
          <url-pattern>/ovdc/*</url-pattern>
            <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>
       <role-name></role-name>
      </auth-constraint>

    </security-constraint>
0
ahuen
Asked:
ahuen
  • 3
  • 2
1 Solution
 
cheekycjCommented:
try overriding the hasRole() method.

CJ
0
 
ahuenAuthor Commented:
CJ,

where? in JDBCRealm?
I am subclassing JDBCRealm.

thanks.
0
 
cheekycjCommented:
yes when you subclass JDBC Realm you should override the hasRole() method to always return true.. Its just an idea but it should work.

CJ
0
 
ahuenAuthor Commented:
awesome....

thanks.
0
 
cheekycjCommented:
Thanx for the "A".  Good luck.

CJ
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now