This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat Realm JNDI problem

 
Allahbaksh Asadullah
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I tried whole day with tomcat JDNI authentication. With below parameter it works fine with Active Directory. But when I use Tomcat realm I am not able authenticate my self.



SearchControls searchCtls = new SearchControls();



// Specify the attributes to return

// String returnedAtts[] = { SN, MEMBEROF };

String returnedAtts[] = { �sn�, �member� };

searchCtls.setReturningAttributes(returnedAtts);



// Specify the search scope

searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);





String searchFilter = "(&(objectClass=group)(&(objectCategory=group))("

+ sAMAccountName+ "=" + userId + "))";



// Specify the Base for the search

// an empty dn for all objects from all domains in the forest

String searchBase = "";



NamingEnumeration results = ctx.search(searchBase, searchFilter,

searchCtls);







Below are few configuration which I tried





<Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"

connectionURL="ldap://192.168.200.57:3268"

roleName="cn"

userSubtree="true"

userSearch="(sAMAccountName={0})"

/>



<Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"

connectionURL="ldap://192.168.200.57:3268"

userPattern="{0}"

userSubtree="true"

/>



Can some one let me know equivalent of the same in Tomcat Server.xml
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic