you can add a user / password in tomcat-users.xml and assign the
roles="admin" to this
user. Can you restrict access to a servlet using .htaccess in tomcat. I am
pretty interseted
in it also.
----- Original Message -----
From: "Cory L Hubert" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 4:20 AM
Subject: Basic Authentication via .htaccess
Can someone point me in the right direction. I need to setup Basic
Authenication. I am currently using a .htaccess file and I would like to
use it to authenticate users. So I have in my web.xml
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<url-pattern>/free?action=getMemberform</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>
Obviously I don't have a realm named Admin or a role named
Admin. Does anyone know how to get it to use the .htaccess?