Advertisement

06.05.2008 at 01:57PM PDT, ID: 23461912
[x]
Attachment Details

How do I pass HTTP authentication to JNDI for Active Directory using Tomcat?

Asked by DJmistral in Java Naming & Directory Interface (JNDI), Java Server Pages (JSP), Jboss Application Server

Tags: Java, IE6

I currently have IIS with the Jakarta redirector to JBoss/Tomcat. I turn Tomcat authentication off in order to have IIS do the HTTP authentication for me (Integrated Windows Authentication).

What I want to do is be able to also query Active Directory from a webpage for things like group membership and e-mail addresses.

How do I pass the HTTP authentication to JNDI in order to query Active Directory so that I never need to ask the user for userID/password (since IIS/Tomcat can do this silently)??

My current solution requires me to store a generic AD user account or ask the user for their password (username can be read by request.getRemoteUser()):

Start Free Trial
1:
2:
3:
4:
5:
env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.setProperty(Context.PROVIDER_URL, activeDirectory);
env.setProperty(Context.SECURITY_AUTHENTICATION,"simple");
env.setProperty(Context.SECURITY_PRINCIPAL, username);
env.setProperty(Context.SECURITY_CREDENTIALS, password);
 
Keywords: How do I pass HTTP authentication to J…
 
Loading Advertisement...
 
[+][-]06.07.2008 at 10:57PM PDT, ID: 21737658

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Java Naming & Directory Interface (JNDI), Java Server Pages (JSP), Jboss Application Server
Tags: Java, IE6
Sign Up Now!
Solution Provided By: ramazanyich
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628