tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Birte Glimm" <B.Gl...@e-7.com>
Subject How to configure basic authentication
Date Fri, 05 Jan 2001 16:36:04 GMT
Hi,
I`m using tomcat 3.2.1, Win 2000 and I tried to configure a servlet (Header, displays just
all received Header information) with basic authentication. I changed the web.xml as followed:

    <servlet-mapping>
        <servlet-name>
            Header
        </servlet-name>
        <url-pattern>
            /protected/Header
        </url-pattern>
    </servlet-mapping>
		<security-constraint>
			<web-resource-collection>
				<web-resource-name>Birtes Protected Area</web-resource-name>
				<url-pattern>/protected/*</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>tomcat</role-name>
			</auth-constraint>
		</security-constraint>

    <login-config>
      <auth-method>BASIC</auth-method>
      <realm-name>Birte</realm-name>
    </login-config>

That works (http://localhost/myApp/protected/Header). But if I enter http://localhost/myApp/servlet/Header
I also get the servlet but without authentication. Why and what must I do that the servlet
is only available with the first URL.

Thanks Birte
Mime
View raw message