You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Michael D. Kirkpatrick" <wi...@psychodad.com> on 2003/03/29 00:04:37 UTC

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.

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.

Can anyone offer some guidance here?

Any help in the matter would be greatly appreciated.
Thanks in advance.

Michael D. Kirkpatrick


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Multiple databases for basic auth

Posted by "Michael D. Kirkpatrick" <wi...@psychodad.com>.
Thanks for you help.  That worked out well enough to do the job.


"Craig R. McClanahan" wrote:

> On Fri, 28 Mar 2003, Michael D. Kirkpatrick wrote:
>
> > Date: Fri, 28 Mar 2003 17:04:37 -0600
> > From: Michael D. Kirkpatrick <wi...@psychodad.com>
> > Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> > To: tomcat-user@jakarta.apache.org
> > 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: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Multiple databases for basic auth

Posted by "Craig R. McClanahan" <cr...@apache.org>.

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

> Date: Fri, 28 Mar 2003 17:04:37 -0600
> From: Michael D. Kirkpatrick <wi...@psychodad.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> 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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org