This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
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.
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.
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.