This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Need Help with FORM Based Authentication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "Need Help with FORM Based Authentication" Watch "Need Help with FORM Based Authentication" New topic
Author

Need Help with FORM Based Authentication

K DeLucia
Ranch Hand

Joined: Apr 11, 2008
Posts: 68
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
Marshal

Joined: Mar 22, 2005
Posts: 42022
    
  64
<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.


Ping & DNS - my free Android networking tools app
K DeLucia
Ranch Hand

Joined: Apr 11, 2008
Posts: 68
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
 
GeeCON Prague 2014
 
subject: Need Help with FORM Based Authentication