jQuery in Action, 2nd edition*
The moose likes Tomcat and the fly likes JSP and Active Directory Integration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "JSP and Active Directory Integration" Watch "JSP and Active Directory Integration" New topic
Author

JSP and Active Directory Integration

Shobhit Khandelwal
Greenhorn

Joined: Feb 19, 2009
Posts: 24
Hi,

I am using Tomcat 5.5. I need to enable Windows authentication such that when user hits the login.jsp, his credential should be checked against Active Directory domain and move forward to next page,if success. I have already update conf/server.xml and web.xml of my application with some help available on net. Kindly provide some idea.

Thanks,
Shobhit
SCJP 5.0
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

Welcome to the JavaRanch, Shobhit. Active Directory is an LDAP server, so look at the Tomcat docs that have to do with setting up an LDAP-based security realm. You will also find a lot of stuff on that subject if you use Google.

In order for the Realm to properly control the webapp, the webapp has to have been written to use container-based security and have the appropriate security definitions added to the webapp's web.xml file. They're what determine how the different URLs passed to the webapp are guarded by the security Realm, what the login and loin failure pages are, and what security roles will be applied.


Customer surveys are for companies who didn't pay proper attention to begin with.
Shobhit Khandelwal
Greenhorn

Joined: Feb 19, 2009
Posts: 24
Thanks Tim . I read tomcat docs and tried many things but still its not working as it should be. Here is my webapp_root/WEB_INF/Web.xml file :



And server.xml with ldap-settings :



Kindly have a look at the code and suggest me what else should I do to authenticate my intranet application against active directory.Thanks.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

roleName is supposed to be the name of an AD entry attribute that holds a role value. You've hard-coded a role value where its name should have been.
Shobhit Khandelwal
Greenhorn

Joined: Feb 19, 2009
Posts: 24
Thanks Tim for your efforts.
I got the solution by following instruction of this nice tutorial(video presentation) http://alextch.members.winisp.net/TomcatAndAD/TomcatAndAD.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP and Active Directory Integration
 
Similar Threads
Integrating Active Directory with LDAP
Active Directory Authentication using java
Creating an EJB from Active Directory
JNDI, connect to M$ AD, search for users, change passwords etc.
How to Access mail boxes from MS Exchange Server ?