Solved

Usernames and Servlets

Posted on 2001-06-20
5
241 Views
Last Modified: 2013-11-24
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
Comment
Question by:philipstewart
5 Comments
 

Expert Comment

by:smileyxx
ID: 6211634
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
 

Expert Comment

by:Nachiap
ID: 6212985
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
 

Author Comment

by:philipstewart
ID: 6213415
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
 

Accepted Solution

by:
Nachiap earned 20 total points
ID: 6213474
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
 

Expert Comment

by:CleanupPing
ID: 9062027
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
split string containing \r\n in Java 46 38
oracle 11g 23 49
varialbe initialization 11 30
eclipse with Angularjs2.0 3 17
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now