Experts..
I'm trying to setup a basic authentication (and later move on to form authentication) within a web application I've created. I have a basic installation of tomcat4, but when I added a security-constraint to the web-xml file.. it's not working. My directory structure looks like:
webapps
- dev.mjkstudios.com
- WEB-INF
- web.xml
- index.jsp
My web-xml file follows:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"
http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>dev.mjkstudi
os.com</di
splay-name
>
<description>
MJK Studios development area
</description>
<!-- SECURITY CONSTRAINT -->
<security-constraint>
<web-resource-collection>
<web-resource-name>Protect
ed area</web-resource-name>
<url-pattern>*.jsp</url-pa
ttern>
<http-method>GET</http-met
hod>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-nam
e>
<role-name>tomcat</role-na
me>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE<
/transport
-guarantee
>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-m
ethod>
</login-config>
<!-- SECURITY ROLES -->
<security-role>
<description>the administrator role</description>
<role-name>admin</role-nam
e>
</security-role>
<security-role>
<description>everyone else</description>
<role-name>tomcat</role-na
me>
</security-role>
</web-app>
--------------------------
----------
----------
----------
----------
----------
---
I've setup a subdomain on my site to access this web application:
http://dev.mjkstudios.comYou'll see that on visiting the page (index.jsp), no authentication is requested.
Any idea what my problem is?
FastBiscuit
Start Free Trial