Solved

Usernames and Servlets

Posted on 2001-06-20
5
240 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

760 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