2

I want to make the manager app to work with LDAP, at the moment i have managed to make manager app to work with the realm org.apache.catalina.realm.MemoryRealm but i need to make it work with this realm org.apache.catalina.realm.JNDIRealm. I have set the realm in the context.xml file like this:

<Realm resourceName="nalytics-web-ldap-realm" allRolesMode="authOnly"
                        className="org.apache.catalina.realm.MemoryRealm" connectionName="uid=admin,ou=system"
                        connectionPassword="myPassword" connectionURL="ldap://localhost:10389"
                        debug="99" userBase="ou=product,o=company,dc=com" userRoleName="memberOf"
                        userSearch="cn={0}" userSubtree="true" />

and my tomcat-users.xml is:

<tomcat-users xmlns="http://tomcat.apache.org/xml"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
              version="1.0">

  <role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <role rolename="manager-jmx"/>
  <role rolename="manager-status"/>
  <role rolename="admin-gui"/>
  <role rolename="admin-script"/>
  <user username="deployer" password="deployer" roles="manager-gui,manager-script"/>
</tomcat-users>

Finally my manager.xml file is:

<?xml version="1.0" encoding="UTF-8"?>
<Context privileged="true" antiResourceLocking="false" docBase="${catalina.home}/webapps/manager">
    <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1"  />
</Context>

What settings/configurations do i need to do in order to make manager app to work with realm org.apache.catalina.realm.JNDIRealm? After researching i found that i have to create role names in LDAP and put there the username and then change the WEB-INF/web.xml of the manager to match the new role names but i am not sure as i haven't done something similar before. Anyone who has achieved to make the manager app to work with LDAP it would be very helpful to share what they did.

cousma
  • 87
  • 1
  • 10

0 Answers0