How do I setup authentication with LDAP on Apache Tomcat?

Solution Unverified - Updated -

Issue

  • I'm trying to implement security in Tomcat, using the documentation Realm How-To JNDIRealm

  • I tried to use the same configuration as defined in the Tomcat URL for configuring the LDAP, but once the LDAP is configured I created a realm like:

<Realm className="org.apache.catalina.realm.JNDIRealm" name="jndibase"
     connectionURL="ldap://ipa.bne.redhat.com:389"
     alternateURL="ldap://ipa.bne2.redhat.com:389"
     userPattern="cn=users,cn=accounts,dc=bne,dc=redhat,dc=com"
     roleBase="cn=roles,cn=accounts,dc=bne,dc=redhat,dc=com"
     roleName="cn"
     roleSearch="(member={0})"/>

Environment

  • Enterprise Web Server (EWS)
    • 2.x
  • JBoss Web Server (JWS)
    • 3.x
    • 5.x
  • Tomcat
    • 6
    • 7
    • 8

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In