views:

585

answers:

2

Here's my situation:

I want stuff under

mysite/customer/*

to require form-based authentication before access (login via mysite/customer/login.jsp, with its own user_password table and role. )

BUT

I want stuff under

mysite/admin/*

to require another form-based authentication before access (login via mysite/admin/login.jsp, with another set of admin_user_password table and role. )

Is it possible to do this under Tomcat 6.0? If so, can someone briefly describe how I could go about implementing this? I've looked around and only seen examples of 1 Realm setup...havent seen multiple Realm setup before.

I use JDBCRealm.

+3  A: 

I think that is not possible. You could go the filter way in which you setup a filter for the customer side of your tree and another filter for the admin side. Take a look here.

The other way is to setup two applications in tomcat in two different contexts using single sign on within tomcat. In this way you would have /mysitecustomer and mysiteadmin as two different applications sharing one realm but having two different login pages.

rmarimon
A: 

BTW - from my reading, the Context is the preferred mechanism. I am setting up the model for my consulting business for partitioning customers that need some hosted web app and staging it on my server for my convenience.

mobibob