Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Hamak Waddle
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18020
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Hamak Waddle
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18020
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic