File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes system properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "system properties" Watch "system properties" New topic
Author

system properties

vivek sivakumar
Ranch Hand

Joined: Aug 09, 2001
Posts: 187
hi tell me how to proceed !!
i have a java application (nothing but a collection of jsp pages) where i authenticate the contents of the jsp page by a user name password , what i need is that this username and password should be taken directly from the windows system!! to be more clear the user if authorised to enter into the windows system then he should be also auhorised to use my application.
is there any class in java to do this or can anyone givea smaple code.


SCJP, SCWD <br />A farmer learns more from a bad harvest than a good one.
Mo Ibrahim
Greenhorn

Joined: Jul 10, 2001
Posts: 28
Getting the user name is easy. You can get the logged-in user name by executing "cmd echo %username%" in a process and read the stream using an InputBufferStreamReader.
But, you will not be able to get the password from windows because of encoding. I heard someone say that you can set a registry key and get the password out. I do not know how. I am also looking for a way to figure out a solution to this problem. If you find out, please post it.
Peter Kristensson
Ranch Hand

Joined: Jul 02, 2001
Posts: 118
I find it hard to believe that the username is stored in plain text anywhere on your windows system. If this was the case, someone would probably have found out by now, and used this information with malicous intent.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I believe that it is possible with JAAS (PAM framework)
There is a native module nt.dll for Windows NT.
Links
<install-dir>/jaas1_0/jaasmod1_0-win/doc http://java.sun.com/products/jaas/index-14.html

Pierre-Fran´┐Żois Lemosquet
Wokup! http://www.wokup.fr
jasonkosowan
Greenhorn

Joined: Sep 07, 2001
Posts: 25
Yikes, this is a bit tough. Remind me why we can't just use .htaccess?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: system properties