• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Authnetication and getRemoteUser()

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
 
reply
    Bookmark Topic Watch Topic
  • New Topic