Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP and Active Directory Integration

 
Shobhit Khandelwal
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18303
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Shobhit Khandelwal
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18303
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic