GeeCON Prague 2014*
The moose likes Servlets and the fly likes Need to get the user id of the machine raising the request. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Need to get the user id of the machine raising the request." Watch "Need to get the user id of the machine raising the request." New topic
Author

Need to get the user id of the machine raising the request.

Kannan Raman
Greenhorn

Joined: Nov 14, 2008
Posts: 7
Hello Team,

I have to get the logged in user id of the client machine using jsp/servlet.

Let me explain my query briefly.

For displaying the user name in a portal,I need to track the window's logged in user id.

I hope there is some method namely System.getProperty("User.Name") ;

But this method pulls the server machine's logged in user id.I just want the logged in user id (Windows User id) of the client machine which is
making the request.

I am not supposed to use any of the authentication mechanisms (namely BASIC, Form Based etc..) .


Any help towards this query is greatly appreciated.


manoj r patil
Ranch Hand

Joined: Jun 06, 2002
Posts: 181
On MS platform, you can do it easily, e.g. MS SharePoint.

I don't think you can access client side OS user id from servlet/jsp. I don't remember any such method even in javascript although I am not sure.

I was wondering what would be the need for tracking the window's user id. Are you not using notmal login page and using the OS credential instead?


love your job and not your company;
...because you never know when your company will stop loving you!
Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
Both jsp and servlet has nothing to do in your situation because all they are executed on server side and you need information about client system. So a few google search provides something to think about.

1) Using pure javascript navigator object you may get browser specific information but not os user, you may want to look at this:
http://www.w3schools.com/JS/tryit.asp?filename=try_dom_navigator

2) Some further research claims that it is possible using ActiveX Object. But remember that browser threats ActiveX objects in a special way for security reasons. User or System default may disable ActiveX Objects, so they are not trustworthy in my opinion. But you may want to give a try :
http://searchdomino.techtarget.com/tip/0,289483,sid4_gci1212258,00.html

Hope this is not for something like single sign on.

Good Luck
Kannan Raman
Greenhorn

Joined: Nov 14, 2008
Posts: 7
Hi Manoj,

First of all thak you so much for your reply.

The thing is that I don't want form based authentication,since that is overhead of typing the login information again. But I am sure

that we can track the user id from java.
 
GeeCON Prague 2014
 
subject: Need to get the user id of the machine raising the request.