aspose file tools*
The moose likes Tomcat and the fly likes Restricting Access to Home Page but allowing access to everything else under it Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Restricting Access to Home Page but allowing access to everything else under it" Watch "Restricting Access to Home Page but allowing access to everything else under it" New topic
Author

Restricting Access to Home Page but allowing access to everything else under it

Hamak Waddle
Greenhorn

Joined: Oct 16, 2012
Posts: 2
I would like to create restrictions as follows in Tomcat:

Restrict this page..... http://example.com:7070/abc

But still give access to all to urls such as http://example.com:7070/abc/personId=ioiedqw990,Password=mypasswd

or anything else falling under http://example.com:7070/abc

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

You place user IDs and passwords as plain text right out in the URLS? Wow! I'm going to totally own your application!

I thought 7070 was the port that WebLogic liked. This is the Tomcat forum.

Regardless, a URL in the form "http://example.com:7070/abc" would be routed to the welcome page of the webapp deployed under the context name of "abc". You could just code up a straight HTML page that says "Access forbidden", configure it as the welcome page in the WEB-INF/web.xml file and be done with it.


Customer surveys are for companies who didn't pay proper attention to begin with.
Hamak Waddle
Greenhorn

Joined: Oct 16, 2012
Posts: 2
This is my login page http://example.com:7070/abc (though it actually uses 8080) but I didn't want people to login except a few admins. And the urls must not be restricted. Problem is I have been having login attempts which the boss doesn't like and so he didnt want anybody else accessing this page but the admins.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

There is information missing here. The only way that "/abc" can be a "login page" is if you deployed the webapp at the root context and have mapped a servlet to the URL "/abc".

Of course, it also implies that you are using a user-designed "insecurity" system. I call it that, because I've worked with webapps in many environments for many years and have never yet seen a user-designed system that was actually secure.

The only real way you can block access to a login is to do something like filter out attempts from unauthorized client IP addresses. Until you log in, the app will have no way of knowing who the user is, and therefore no way of knowing whether the user is permitted to log in. The prescience module for Tomcat is currently broken.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Restricting Access to Home Page but allowing access to everything else under it