Requiring authentication to get to the EE pages

From Dogtag
Jump to: navigation, search

Question: How do we set things up so that any user that wishes to access the EE pages must first authenticate with an LDAP directory?


This is a mechanism to require user authentication prior to the user even accessing the Certificate Authority's EE pages. This was tested on RHCS 8, although similar configuration should work for dogtag 10. In that case, the paths referred to in the instructions will be different.

You could do this by fronting the CA with another server (an apache server, for example, if they wanted to do some other processing.  But the basic requirement could be satisfied by configuring the CA (which is a Tomcat web server) to perform LDAP authentication prior to executing the request.  This is done by configuring a Tomcat JNDI realm.

The steps to do this are as follows:

  1. Configure a CA.  We will assume for these instructions that the CA has the instance name pki-ca.
  2. Edit /var/lib/pki-ca/conf/server.xml. Replace the following stanza:
      <!-- This Realm uses the UserDatabase configured in the global JNDI
           resources under the key "UserDatabase".  Any edits
           that are performed against this UserDatabase are immediately
           available for use by the Realm.  -->
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
      <Realm className="org.apache.catalina.realm.JNDIRealm"

The details of the ldap connection and the relevant DN pattern and groups/roles needs to be configured accordingly.

  1. Edit /var/lib/pki-ca/webapps/ca/WEB-INF/web.xml. At the end of the file, add:
       <realm-name>PKI Certificate Authority</realm-name>


           <web-resource-name>EE Services</web-resource-name>

BASIC authentication will provide a simple pop-up which asks for the user name and password.  It is also possible to configure FORM authentication, but you would have to write the form.  It is also possible to map LDAP groups to security roles.

  1. Restart the CA.

The above configuration was tested and appeared to work for enrollment, user initiated cert renewal and user initiated revocation.  Because we are limiting the security constraint to /ee/ca/* servlets, agent and admin interfaces are unaffected.  Agent interfaces require client auth as before.

More details on the configuration options for a tomcat realm can be found here: and

Note that there are some cases in which we access the EE servlets during the installation of other RHCS subsystems.  For example, during the installation of a KRA, we contact the CA on the EE interface to issue the KRA's subsystem certificates.  So, installation of new subsystems (involving this CA) may require this realm to be temporarily turned off.