Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Windows UID  RSS feed

 
Edy Yu
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know if it is approperiate to put this question here.
The scenario is I am building an intranet application by JSP/servlet. For the user authentication part, I want to retrieve the user ID from its NT domain. I guess I have to write some client side code like VBScript or JavaScript to do that.
Does anybody have any ideas?
Thanks in advance.
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have never done this. But did you look at the API for this?
It's:
HttpServletRequest.getUserPrincipal()
public java.security.Principal getUserPrincipal()
Returns a java.security.Principal object containing the name of the current authenticated user. If the user has
not been authenticated, the method returns null.
[ January 16, 2002: Message edited by: Tony Alicea ]
 
Edy Yu
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tony.
For the HttpServletRequest.getUserPrincepal() method, it deal with the user authentication set in the deployment descriptor.(web.xml).
I don't think server side code including JSP/Servlet is able to handle this job because the Windows UID is pretty much at the client side.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edy,
As far as I know you can't do this easily. It's just not possible without writing a custom OCX kind of thing and then getting into a ton of headaches. Basically, you need access to some raw Windows calls, and you just can't do that in Javascript. VBScript limits what you can do in that respect too. I'd love it if someone managed to correct me on this and showed an easy implementation, but I've seen several people try and fail to do this.
Kyle
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!