• 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

how can I get username in my web application.

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use IIS 6.0 and Tomcat 5.5.7.

In IIS -> Directory Security -> Authentication Methods, I set the
"Digest Auth. for windows domain servers" checkbox so that users can
log on by domain username/passwords.

When user wants to enter the site windows login panel appears, after
entering the domain username/password user can login.

But I could not found a way to get the username in my jsp/servlet.
Is it possible? how?
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SERVER || network || CLIENT || BROWSER

You can NOT have a Windows (or any other) login screen appear on a client by issueing any command from a server in a web application.
If you could I could also create a web application that shuts down your computer or formats its harddisk.
 
ertan eyimaya
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry. I did not explain correctly. The login panel is not for windows login but web login.??? When you fallow the steps mentioned in the question in IIS it asks for username/password and If I enter a domain username/password web page opens.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as I'm aware, that particular authentication mechanism stores hashed credentials for an authenticated user in Active Directory (or possibly against the Domain Controller, can't remember which). So the only place you can get them is from AD, except of course they will be hashed so no use to you. You can get the username if you use basic authentication (but of course, the password is send in clear text), or you could use NTLM. The vagueries of how to do that are dotted about the Security forum.
 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try here.
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ertan,

It is possible with HTTP Basic Authentication. You need to declare the protected resources in web.xml file and specify the Basic Authentication. When a user tries to access the protected resources, the browser will prompt for the username/password. You can authenticate the user using the specified relam.

I hope it gives the answer to your question.

Anil Sadineni.
 
reply
    Bookmark Topic Watch Topic
  • New Topic