• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need Help with FORM Based Authentication

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to get Tomcat FORM based authentication to work and I'm not having any luck. I'm sure it's something stupid I'm missing, but I haven't been able to figure it out.

I have the following in my <tomcatRoot>\webapps\RFS7\WEB-INF\web-xml


I have the following in my <tomcatRoot>\webapps\RFS7\WEB-INF\rfs7.xml (I want this login/security to only apply to this application, at least for now)


I have the following in the <TomcatRoot>\conf\tomcat-users.xml file:


And my login form contains (among other things) this:


When I bring up the application at this url: http://localhost/RFS7/request.jsp the page comes up perfectly, but I'm not prompted to login like I expected. What am I doing wrong?

Do I need to edit the server.xml at all? Any pointers or help are much appreciated. Thanks!

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

<url-pattern>/RFS7/*</url-pattern>


URL patterns are relative to the web app root; try "/*" instead.

I have the following in my <tomcatRoot>\webapps\RFS7\WEB-INF\rfs7.xml


What's the significance of this file?

I have the following in the <TomcatRoot>\conf\tomcat-users.xml file:


That file should contain the users and their password and roles; I'm surprised this doesn't cause an exception.
 
K DeLucia
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you! It's working now. The main problem was the url-pattern.

The rfs7.xml was something I added as I tried to work through this. Somewhere I found information about adding an xml file specific to the application, but I'll just forget all about that. ;-) I deleted it.

And my tomcat-users did contain users, passwords and roles. I mistakenly posted the wrong file contents.

In any case, thank you very much for the help!
Karen
 
reply
    Bookmark Topic Watch Topic
  • New Topic