tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: BASIC Authentication
Date Fri, 06 Oct 2000 19:08:40 GMT
Micky Mimo wrote:

> I have tried setting up Basic Authentication for tomcat and can not seem to
> get it to work on directories that are not part of the basic install. It
> works fine when I set this up with the /ROOT directory. I have read through
> the news groups and have not found a solution to this problem. Although, I
> see a lot of similar problems. Do I need to do more with the other xml files
> in the conf directory. I am running tomcat 3.2 beta4. I can not get this to
> work on 3.1 as well. My web.xml looks like the following.

Don't bother trying to get this to work in 3.1 ... it will not.

In 3.2b4, exactly what is "not working" for you?  The setup in your web.xml
below looks good -- you are saying that any context-relative path starting with
"/secure/*" should be protected.

In other words, if your context path is "/myapp" the following request should
trigger the authentication dialog:

    http://localhost:8080/myapp/secure/index.html

Craig McClanahan

>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <!DOCTYPE web-app
>     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
>     "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
>
> <web-app>
>
>     <security-constraint>
>       <web-resource-collection>
>          <web-resource-name>Protected Area</web-resource-name>
>          <url-pattern>/secure/*</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>admin</role-name>
>       </auth-constraint>
>     </security-constraint>
>
>     <login-config>
>       <auth-method>BASIC</auth-method>
>       <realm-name>Admin</realm-name>
>     </login-config>
>
> </web-app>
>
> /===============================\
> | Micky Mimo                    |
> | Systems Specialist            |
> | (781) 869 - 3677   ext.505    |
> | micky@truexchange.com         |
> \===============================/

--
====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat



Mime
View raw message