On Fri, 28 Mar 2003, Michael D. Kirkpatrick wrote:

> Date: Fri, 28 Mar 2003 17:04:37 -0600
> From: Michael D. Kirkpatrick <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Multiple databases for basic auth
>
> I am running Tomcat 4.1.
> I have successfully configured the default basic auth to work with MSSQL
> 2000.
>
> I have multiple clients.  Each one wants their own "User" database to
> administer for themselves.  That is fine, but I can't seem to configure
> Tomcat to respect a different User Database for each different app.  I
> have messed with web.xml till I am blue in the face.  No such luck with
> getting Tomcat to use any other database except for the server default.
>

Messing with web.xml is not going to help you -- messing with server.xml
is where you really need to do things.

A couple of different general approaches become possible:

* If you set up a <Host> element for each of your clients, and allow
  the clients to run multiple webapps, simply nest a <Realm> element
  inside the <Host> element -- this <Realm> will be the authentication
  database for all the webapps used by that client.

* If you set up a single webapp for each client, simply nest a <Realm>
  element inside a <Context> element for that webapp.

Which realm should I use?  If your underlying data is accessible via JDBC
(as it sounds like is the case for you), using JDBCRealm is probably your
best bet.  Configuration details can be found in:

  http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/realm.html

> I realize that Tomcat is different then Apache.  Since they both are
> made by the same people, and Apache can easly do something simular, I
> figure it can be achieved with Tomcat as well.  I can't control the
> authentication with Apache since I am using a Linux box to access MSSQL
> 2000 with the Java drivers.
>

Tomcat and the HTTPD server are not, in fact, made by "the same people".
Although they both come from "Apache", that currently represents several
hundred different folks that have commit access to at least one Apache CVS
repository :-).

> Can anyone offer some guidance here?
>
> Any help in the matter would be greatly appreciated.
> Thanks in advance.
>
> Michael D. Kirkpatrick
>

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to