• 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

Check user of NT domain or active directory in servlet?

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,
Is there a way in which a user from NT domain or active directory is verified in a servlet? I mean when a user logs in a J2EE web application by using his/her NT user account, how this user is authenticated against NT domain's user account database in JSP/servlet.
If you have the solution, would you please give me a sample code for that?
THanks in advance.
Lijun
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Lijun An:
Dear all,
Is there a way in which a user from NT domain or active directory is verified in a servlet? I mean when a user logs in a J2EE web application by using his/her NT user account, how this user is authenticated against NT domain's user account database in JSP/servlet.
If you have the solution, would you please give me a sample code for that?
THanks in advance.
Lijun


I have not done this myself, but I would guess you could use JNDI of some sorts to connect to Active Directory.
A (slightly off topic) solution to your problem could be to let the webserver handle authentication. I don't know your configuration, but the following might work for Apache/Tomcat with mod_jk.
You can have Apache send out authentication headers, which it validates via Samba (use mod_auth_smb). I guess you should be able to retrieve the username in the servlet from the environment variables.
Hope this helps, if you need more detailed info, let me know.
Zoran
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic