It's not a secret anymore!
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
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: 42958
    
  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: 17146
    
  27

"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 .


An IDE is no substitute for an Intelligent Developer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: User authentication
 
jQuery in Action, 3rd edition