This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need Help with FORM Based Authentication

 
K DeLucia
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • 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!

 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • 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: 68
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic