This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths 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 Head First Android this week in the Android 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
Rancher

Joined: Mar 22, 2005
Posts: 42956
    
  73
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.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16901
    
  26

"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
 
It's not a secret anymore!