Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Apache Tomcat
|
Apache Tomcat General discussion of the Apache Tomcat servlet container. For discussions specific to the Professional Apache Tomcat book, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Apache Tomcat section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 7th, 2004, 06:56 AM
Registered User
 
Join Date: Apr 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default tomcat JNDIRealm authentication not working

I need to configure tomcat to prompt a basic authentication dialogue and authenticate users against the Active Directory. I could get the dialogue but after entering the valid userid and password I get the "authentication failed" messages.

Please guide me on how to resolve the issue?

Here are the steps that I followed.
1. Copied JNDI.jar and ldap.jar to tomcat/server/lib folder
2. In the server.xml file added following,

<Realm name="test" className="org.apache.catalina.realm.JNDIRealm" debug="99"
     connectionURL="ldap://agni:389"
     userBase="CN=Users,dc=company,dc=com"
     userSearch="(userPrincipalName={0})"
     userRoleName="member"
     roleBase="CN=Users,dc=company,dc=com"
     roleName="cn"
     roleSearch="(member={0})"
connectionName="CN=Administrator,CN=Users,DC=compa ny,DC=com"
     connectionPassword="adminpass"
     roleSubtree="true"
     userSubtree="true" />

[Here for 'company' I used my company's domain]

3. In Web.xml file I added
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>
                Entire Application
            </web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>manager</role-name>
        </auth-constraint>
    </security-constraint>

    <login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>test</realm-name>
    </login-config>

4. Restarted tomcat

System: Windows 2000,tomcat 4.1.24, jdk1.4.1





Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Hosting Setup Not Working In Tomcat 6 00codefinder Apache Tomcat 2 December 12th, 2007 11:26 PM
JSP pages not working after reinstalling Tomcat sagar.singh Apache Tomcat 3 October 24th, 2007 01:28 AM
problem in tomcat working in linux frozen84 Apache Tomcat 1 January 2nd, 2007 01:56 AM
JWS Axis Tomcat (posted to Apache Tomcat too) rushman Servlets 0 April 15th, 2005 09:32 AM
Tomcat 3.3.2 to Tomcat 5.0.24 amith_pj Apache Tomcat 1 July 4th, 2004 10:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.