• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 250
  • Last Modified:

Usernames and Servlets

Is there any way that I can get a users login id when they access my servlet?

I know that you can do this in ordinary Java using:

System.getProperty("user.name");

...but this does not work with servlet and will only retrieve the servler login.

The user does not pass their login ID with the request parameters.

Any ideas???

Philip
0
philipstewart
Asked:
philipstewart
1 Solution
 
smileyxxCommented:
If you do user authentication (login) than you can.
A request coming in over HTTP has no information about the user that is making that request.
0
 
NachiapCommented:
are you getting user name or id & password while login..?
if so then u can access that information & stop him accessing that servlet.
you can have login name or id in session or in database..
& check where ever you want..
0
 
philipstewartAuthor Commented:
Hi

The user does not have to login, but I need to get their ID to do security checks, in the background (and also without the user knowing  -- more so the user doesn't have to know as this is then used to determine what resources they have access to.

Thanks
0
 
NachiapCommented:
In Http request you cant distinguish between requests
(as of my knowledge).
so you have to have some login procedure as per your requirement..
0
 
CleanupPingCommented:
philipstewart:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now