This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates 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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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: 42365
    
  64
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: 16158
    
  21

"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