• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JNDIRealm in Tomcat 6.0

 
Vijay Krishnan Chennai
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I got this working in Tomcat 5.5

Server.xml
==========
<Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
connectionURL="ldap://XX.XXX.XXX.XXX:389"
userBase="ou=myCompanyusers,dc=cts,dc=com"
userPattern="{0}@mycompany.com"
/>

web.xml
=======
<security-constraint>
<web-resource-collection>
<web-resource-name>Portal</web-resource-name>
<description>...</description>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
<http-method>DELETE</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>*</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>mycompany</realm-name>
</login-config>

I tried the same thing in Tomcat 6.0 but the authentication popup keeps coming and finally authentication fails. If i switch back to 5.5, it works perfectly. What could be the problem?

Thanks,
Vijay Krishnan
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15448
42
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

I have no experience with this myself, but it's possible that Tomcat 6.0 needs a different way of configuring it than Tomcat 5.5.

Have a look at this in the documentation of Tomcay 6.0 and check if your configuration is correct: Apache Tomcat 6.0 - JNDIRealm
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic