For container based authentication the following example using Tomcat is provided. Please not that the example is not suitable as a viable implementation for production environments.
Apache Tomcat Example
One way of defining users and roles is shown in the following Apache Tomcat example. This is not a viable solution but rather a simple example in order to illustrate the concept. In the example, an XML definition file is used to declare users and their roles in the backend container. Combining the XperienCentral roles with the wmadmin role is a trick to make this work with the default web.xml delivered with XperienCentral. The following file named
tomcat-users.xml defines the users:
- JohnS: assigned role(s): Administrator, with the external name "xc_administrator" assigned.
- MaryP: assigned role(s): Editor and customer-specific permission, with the external names "xc_editor" and "xc_custom_permissions", respectively, assigned.
- JanW: assigned role(s): Casual User, with the external name "xc_casual_editor" assigned.
Container-based Authentication in Tomcat using a Valve
The easiest way to enable container-based authentication in Tomcat for test purposes is by adding this valve:
server.xml: valve to add within the "/web" Context
<Valve className="org.apache.catalina.authenticator.DigestAuthenticator" cache="true" alwaysUseSession="true"/>