Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

After that, add the interceptor to the server.xml file in APACHEDS_INSTALLDIR/conf/. Make sure to backup the file before your modifications. Within server.xml find the XML elements which list the interceptors. The easiest way to add a custom interceptor is to ass add a spring bean (namespace "s"). You my mya set configuration properties to the interceptor as well, if it supports some.

The following fragment shows the interceptor list with the example interceptor added just behind normalization. For demonstration purposes, the hash algorithm is set to "MD5" (which is the default of our interceptor anyway).

Code Block
xml
xml
...
<interceptors>
  <normalizationInterceptor/>
  <s:bean class="org.apache.directory.samples.interceptor.pwdhash.PasswordHashInterceptor"> 
     <s:property name="hashAlgorithm" value="MD5" /> 
  </s:bean>
  <authenticationInterceptor/>
  <referralInterceptor/>
  <aciAuthorizationInterceptor/>
  <defaultAuthorizationInterceptor/>
  <exceptionInterceptor/>
  <operationalAttributeInterceptor/>
  ...
</interceptors>
...

Embedded mode

The As an alternative, the following Java code starts an ApacheDS embedded in a main method. The list of interceptors is complemented with the example interceptor. We insert it exactly behind the NormalizingInterceptor (the position is a little bit tricky to determine).

...