This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes User authentication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "User authentication" Watch "User authentication" New topic
Author

User authentication

Matvey Raz
Greenhorn

Joined: Jul 18, 2013
Posts: 1
Hi,
I'm new on Tomcat, and I am writing my first web application now.
I need to protect some pages with username and password.
Once user logged in, he should access all those (protected) pages without re-login, until the browser (or tab) is closed.
When user re-opens the browser (or tab) and tries to access those pages, he need to login again.
What is the simplest way to do this ?
Thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41034
    
  43
That's what realms and container-managed security is for. Besides setting up users, roles and passwords in one of the ways described there, some changes to your web.xml that describe which URLs to protect may be all you need.


Ping & DNS - my free Android networking tools app
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

"Matvey Rrr",

We don't have many rules here at the JavaRanch, but we do insist that you use your Real Name and not some sort of "handle" or obvious alias. If you're not sure about this, see
http://www.javaranch.com/name.jsp .


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: User authentication
 
Similar Threads
Session Fixation Attack with Tomcat 7
Single login for a Particular url
Login Page
enable multiple users login using the same browser in diffrent tabs
Using default JAAS Mechanism in Websphere makes applications to access the context path of the other