You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Cory L Hubert <cl...@ttech.org> on 2001/05/03 11:20:36 UTC
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?
Re: Basic Authentication via .htaccess
Posted by Xiaofeng Chen <xc...@unlnotes01.unl.edu>.
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" <cl...@ttech.org>
To: <to...@jakarta.apache.org>
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?