• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

FORM authentication with TomCat 5 - jwsdp-1.4

Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

I'm just finished with my little apps (4 jsp and 3 servlets !) and I am trying to implement a simple authentication procedure ...

After a quick look to my "HeadFirst Servlet & JSP" I decided to try a "standard" FORM authentication since it is depicted as a very mere job !

The problem is that whatever I put in my DD web.xml, the server let me access to my JSP and Servlets w/o any request for authentication.

In order to test the server I tried the autentication example from TomCat (/jsp-example/security/protected/) and it works fine ; I guess that the configuration file server.xml is correct.

Herebelow is my DD web.xml and my tomcat-users.xml.

Thanks for any hints from anywhere that could help me find what I've missed

web.xml :
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns = "http://java.sun.com/xml/ns/j2ee"

<servlet-name>Select Ordres</servlet-name>
<servlet-name>Select Ordres</servlet-name>
<servlet-name>MaJ DataBase</servlet-name>
<servlet-name>MaJ DataBase</servlet-name>
<servlet-name>Selection Ordres</servlet-name>
<servlet-name>Selection Ordres</servlet-name>
<servlet-name>Statut Ordres</servlet-name>
<servlet-name>Statut Ordres</servlet-name>
<display-name>Tomcat Server Configuration Security Constraint</display-name>

<!-- Default login configuration uses form-based authentication -->
<realm-name>Tomcat Server Configuration Form-Based Authentication Area</realm-name>

tomcat-users.xml :
==========================================================================<?xml version='1.0' encoding='utf-8'?>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager"/>
<role rolename="admin" description="Administration Tool users"/>
<role rolename="guest" description="affichage seulement"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="role1" fullName="role guest pour l'affichage"/>
<user username="lsalse" password="lsalse" fullName="Laurent SALSE" roles="admin,manager"/>
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
resource only has one s in it...
If you try to please everybody, your progress is limited by the noisiest fool. And this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!