Skip to content

Building Authentication Plugin

Endi S. Dewata edited this page Oct 1, 2026 · 8 revisions

Overview

This page describes the process to build an authentication plugin.

Building Authentication Plugin

Building for PKI 10 or later

An example of a custom authentication plugin is available at /usr/share/pki/server/examples/java/com/example/pki/server/auth/CustomAuthPlugin.java.

To build the plugin example:

$ cd /usr/share/pki/server/examples/java
$ javac \
    -cp "/usr/share/pki/server/common/lib/*:/usr/share/pki/server/webapps/pki/WEB-INF/lib/*" \
    -d /var/lib/pki/pki-tomcat/webapps/ca/WEB-INF/classes \
    com/example/pki/server/auth/CustomAuthPlugin.java

The plugin binaries will be stored in /var/lib/pki/pki-tomcat/webapps/ca/WEB-INF/classes.

Building for PKI 9 or older

$ gtar -zxvf pki_authentication.tar.gz
  • A directory called authentication will be created containing the following files:

    • SSNAuth.java - the source code for this authentication plugin,

    • SSNEnroll.cfg - the configuration file for this authentication plugin, and

    • build.sh - the build script used to create this authentication plugin.

  • Go to the authentication subdirectory:

$ cd authentication
  • It may be necessary to edit the build.sh as the original jar names may have changed:

CLASSPATH=${PKIHOME}/pki-cmsutil.jar:${PKIHOME}/pki-cms.jar:${CLASSPATH}
CLASSPATH=${PKIHOME}/pki-nsutil.jar:${PKIHOME}/pki-certsrv.jar:${CLASSPATH}
  • To build this authentication plugin in the current directory, execute this command:

$ ./build.sh

NOTE: If version 1.5.x or later of javac is used, the user may see something similar to the following warning:

Note: SSNAuth.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

This warning may be safely ignored, as it refers to features specific to Java SDK 1.5 or later.

  • A file called SSNAuth.class should be created in this authentication directory.

Clone this wiki locally