wood burning stoves 2.0*
The moose likes Servlets and the fly likes Authnetication and getRemoteUser() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Authnetication and getRemoteUser()" Watch "Authnetication and getRemoteUser()" New topic
Author

Authnetication and getRemoteUser()

Emil Karlsson
Ranch Hand

Joined: May 23, 2002
Posts: 63
Hi,
I wondering if it is possible to get user username the user has logged on to his w2k with and then use it in a servlet/jsp?
More precisly is it like this I want to do:
1. When a user clicks on a link, his w2k username is fetched and checked against some data that is is stored in a dataset.
2. If the dataset contains the username it will display the desired page. If NOT the dataset contains the username it will display a message page.
-- in other words I don't want to have some username/password to be entered?
Is it possible and if so, how?
/Emil Karlsson
Tom Blough
Ranch Hand

Joined: Jul 31, 2003
Posts: 263
To get the user name you will have to make a native call to a Windows dll. The function you need is WNetGetUser in MPR.DLL. Chech the WinAPI from Micro$oft for details.
I have not coded it in Java, but here it is in VB:


Tom Blough<br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr>Cum catapultae proscriptae erunt tum soli proscripti catapultas habebunt.<hr></blockquote>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Authnetication and getRemoteUser()
 
Similar Threads
how to get the username from session?
how to retrive data from .xls file
How to create user web pages
Calling JOptionPane in A servlet Class
struts beginner. Pls answer this.