Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Kannan Raman
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Fatih Keles
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic