> This is what I want to do: > > 1) I want to setup a database which includes multiple realms > 2) user are linked to realms > 3) I want to use protect a servlet with basic authentication, and I want to > be able refer to the correct realm when performing the authentication (this > means sending the correct realm/user to the database. And I don't want to do > this by hacking the tomcat configuration files. > I didn't see the original post, but just Craig's answer. I'm not sure exactly what you want, but I did something similar that required NO modification of the tomcat mechanisms.
My goal was to allow users to log in with domain\userid to the same application (and use the domain to show them different data) and allow each domain to have its own set of users (e.g. same userid) and be managed independently. I did this with only a couple of minor modifications: My login.jsp collects domain, userid and password. It uses a simple JavaScript one-liner to concatenate domain\userid to create j_username (I use a '\', but you can use any separator char you want (don't use ':' since HTTP uses that as the userid:password separator.). If you want to use BASIC authentication to do this you just need to enter domain\userid as the userid. In the database I use the domain\userid as the 'userid' that I tell Tomcat about in the Realm statement (actually I use an Oracle view to concat the two fields, but that isn't important). This creates multiple user 'domains' very simply but does require the user to enter a domain name in addition to userid and password. Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>
