• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting windows NT login through an applet?

 
Asif Anis
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
helo everyone,
i'm building a web based application for our local Lan in which i want my applet to get me the current user login name of every person who access my site...
can any one help me regarding this ?
waiting for ur replies
thanx
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An applet can use the java.lang.System.getProperty("user.name") call to get the logon ID (if applicable). However, this is almost certainly going to be forbidden by the sandbox when running in a browser.
Another sticky point is that when you talk to a web server your LAN user ID may not apply - Web user IDs and LAN user IDs are only the same if the web server has been configured that way. In IIS, it's a configurable option. In many web servers, it's not - unless the web site is set up for authentication, the user HAS no distinct identity.
 
Asif Anis
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
now what am i supposed to do... i've seen this information of current user id in the window registry and i can use a active x control along with jni to get the current user name but then what will i do if user loginto the system from someother platform?
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, that's the problem. There are systems where you don't have to log in at all, so they HAVE no user IDs. Conversely, a lot of corporate environments have users logged into Novell, NT domains, Windows Workgroups, mainframes, etc. all at once, and they may not all be under the same ID (this can be very messy, but I've experienced it myself!).
In an Internet context, the only meaningful user ID is the one your web server interacts with. For non-IIS servers or IIS using other than Windows user identification, this means that on the server you set up your own user account database. If your web server is doing the authentication, the user ID typically shows up in the server log (it's also available as the REMOTE_USER CGI variable in Apache).
If you are in a controlled (intranet) environment, I'd recommend the System.getProperty() over JNI-ActiveX, though. Either way you have to sign the applet, and getProperty is both more portable and more secure than ActiveX.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic