The authentication subsystem evaluates and authenticates the identity of an end entity that is requesting service from Netscape Certificate Management System (CMS). By default, the authentication subsystem supports various authentication mechanisms; these are explained in "Introduction to Authentication".
Customizing Authentication
Figure 12.1 Authentication subsystem architecture
Table 12.1 Description of components
The setup shown in Figure 12.1 works in the following way:
On the CMS side, a servlet receives the following as input from the form the end entity used:
An attribute set (or authentication parameters)
The servlet then calls the appropriate authentication manager instance to authenticate the end entity.
Finally, a certificate is issued and returned to the end entity.
To authenticate an end entity, an enrollment servlet calls the authentication manager authenticate (IAuthCredentials) method, passing it credentials received in the HTTP input (the HTML form). The authentication manager implementation specifies which HTTP input variables are required for authentication. For example, in the directory-based authentication manager the required credentials are UID and password. If authentication succeeds, an AuthToken is returned. Otherwise, an exception is thrown. IAuthCredentials and AuthToken contain lists of attribute and value pairs.
Table 12.2 AuthToken fields and values
authMgrImplName--the authentication manager's plug-in name (the implementation)
The time of authentication
Step 2. Write the Authentication Plug-in Module
Step 3. Register the Authentication Manager Plug-in Module
Step 4. Create an Instance of the Authentication Plug-in Module
Step 5. Customize the End-Entity Enrollment Forms
When you consider customizing authentication, the first thing to decide is the kind of authentication scheme that you want for your end entities when they enroll for a certificate. In planning the scheme, you must identify and decide on the end-entity attributes Certificate Management System should retrieve from an end-entity request and evaluate the values of. In other words, in this step you must fix the attributes for authentication.
Authentication managers are implemented as Java classes, which are then registered with Certificate Management System as plug-ins. After you decide on the attributes for authenticating end entities, you need to write an authentication plug-in (Java class) that uses those attributes. Keep in mind that the plug-in implementation must conform to the CMS interface, as explained in the section that follows.
To enable you to write custom authentication plug-ins, Certificate Management System provides an authentication manager plug-in API and related classes (Java Docs).
com.netscape.certsrv.authentication.IAuthManager
When you are compiling an authentication manager plug-in using javac, be sure to include CMS classes in the classpath. For example, if a CMS instance named testCA is installed in C:\netscape\server4 (default server root in Windows NT) or usr/netscape/server4 (default server root in Unix), use the following to compile the authentication manager plug-in implementation:
Unix $ set CERT40DIR=usr/netscape/server4/bin/cert/jars $ javac -classpath \ /usr/jdk1.1.6/lib/classes.zip:$CERT40DIR/ ldapjdk.jar:$CERT40DIR/certsrv.jar \ myAuthMgr.java
After compiling an authentication manager plug-in, add it to the CMS authentication framework as explained in the section that follows.
There are two ways in which you can add a custom authentication module class file to the CMS authentication framework. You can either put the class file in the server's default classpath or edit the server's start-cert script to include the path to your authentication plug-in module. The recommended method is that you add your class file to the server's default classpath.
<server_root> is the directory where the CMS binaries are kept. You first specified this directory during installation.
<instance_id> is the ID for this instance of Certificate Management System. You first specified this when you installed this server.
<server_root>/bin/cert/classes/... If your authentication manager is instance specific--which means, it will be used by a specific CMS instance--put the class file in this directory:
<server_root>/bin/cert/classes/...
<server_root>/cert-<instance_id>/classes/...
The default classpath in the start-cert script is as follows:
Unix /usr/netscape/server4/cert-testCA/classes/:/usr/netscape/ server4/bin/cert/classes/:/usr/netscape/server4/bin/cert/jars/ jss.jar:/usr/netscape/server4/bin/cert/jars/certsrv.jar:/usr/ netscape/server4/java/ldapjdk.jar:/usr/netscape/server4/bin/ base/jre/lib/rt.jar:/usr/netscape/server4/bin/base/jre/lib/ i18n.jar:/usr/netscape/server4/bin/cert/jars/jssjdk12.jar
To add a classpath to the start-cert script in Unix:
Go to the CMS-instance directory. For example, /usr/netscape/server4/cert-testCA
Enter the following line at the prompt:
cat start-cert You should see something similar to this: #!/bin/sh /usr/netscape/server4/bin/cert/admin/bin/start -i testCA -r /usr/netscape/server4 -e -classpath /usr/netscape/server4/bin/cert/classes:/usr/netscape/ server4/bin/cert/jars/jss.jar:/usr/netscape/server4/bin/ cert/jars/certsrv.jar:usr/netscape/server4/java/ ldapjdk.jar:/usr/netscape/server4/bin/base/jre/lib/ rt.jar:/usr/netscape/server4/bin/base/jre/lib/i18n.jar:/ usr/netscape/server4/bin/cert/jars/jssjdk12.jar Add your class's directory path to the start-cert script. Be sure to add the directory path to the beginning as shown in the example.
#!/bin/sh /usr/netscape/server4/bin/cert/admin/bin/start -i testCA -r /usr/netscape/server4 -e -classpath <your_class's_directory_path>:/usr/netscape/server4/cert- testCA/classes/:/usr/netscape/server4/bin/cert/classes/:/ usr/netscape/server4/bin/cert/jars/jss.jar:/usr/netscape/ server4/bin/cert/jars/certsrv.jar:/usr/netscape/server4/ java/ldapjdk.jar:/usr/netscape/server4/bin/base/jre/lib/ rt.jar:/usr/netscape/server4/bin/base/jre/lib/i18n.jar:/ usr/netscape/server4/bin/cert/jars/jssjdk12.jar For example, if your class file is in a directory /u/jdoe/myAuthMgrs, here's how the start-cert script would look: #!/bin/sh /usr/netscape/server4/bin/cert/admin/bin/start -i testCA -r /usr/netscape/server4 -e -classpath /u/jdoe/myAuthMgrs:/usr/netscape/server4/cert-testCA/ classes:/usr/netscape/server4/bin/cert/classes/:/usr/ netscape/server4/bin/cert/jars/jss.jar:/usr/netscape/ server4/bin/cert/jars/certsrv.jar:/usr/netscape/server4/ java/ldapjdk.jar:/usr/netscape/server4/bin/base/jre/lib/ rt.jar:/usr/netscape/server4/bin/base/jre/lib/i18n.jar:/ usr/netscape/server4/bin/cert/jars/jssjdk12.jar
Go to the CMS instance directory. For example, C:\netscape\server4\cert-testCA
type start-cert.bat You should see something similar to this: net start cert-testCA /cC:\Netscape\Server4\cert- testCA\classes\;C:\Netscape\Server4\bin\cert\classes\;C:\ Netscape\Server4\bin\cert\jars\jss.jar;C:\Netscape\Server 4\bin\cert\jars\certsrv.jar;C:\Netscape\Server4\java\ldap jdk.jar;C:\Netscape\Server4\bin\base\jre\lib\rt.jar;C:\Ne tscape\Server4\bin\base\jre\lib\i18n.jar;C:\Netscape\Serv er4\bin\cert\jars\jssjdk12.jar;C:\Netscape\Server4\java\ swingall.jar Add your class's directory path to the start-cert command. Be sure to add the directory path to the beginning as shown in the example.
net start cert-testCA /c<your_class's_directory_path>C:\Netscape\Server4\cert- testCA\classes\;C:\Netscape\Server4\bin\cert\classes\;C:\ Netscape\Server4\bin\cert\jars\jss.jar;C:\Netscape\Server 4\bin\cert\jars\certsrv.jar;C:\Netscape\Server4\java\ldap jdk.jar;C:\Netscape\Server4\bin\base\jre\lib\rt.jar;C:\Ne tscape\Server4\bin\base\jre\lib\i18n.jar;C:\Netscape\Serv er4\bin\cert\jars\jssjdk12.jar;C:\Netscape\Server4\java\swingall.jar For example, if your class file is in a directory C:\jdoe\myAuthMgrs\... here's how the start-cert.bat script would look: net start cert-testCA /cC:\jdoe\myAuthMgrs\;C:\Netscape\Server4\cert- testCA\classes\;C:\Netscape\Server4\bin\cert\classes\;C:\ Netscape\Server4\bin\cert\jars\jss.jar;C:\Netscape\Server 4\bin\cert\jars\certsrv.jar;C:\Netscape\Server4\java\ldap jdk.jar;C:\Netscape\Server4\bin\base\jre\lib\rt.jar;C:\Ne tscape\Server4\bin\base\jre\lib\i18n.jar;C:\Netscape\Serv er4\bin\cert\jars\jssjdk12.jar;C:\Netscape\Server4\java\s wingall.jar
To aid you in writing custom authentication managers, Certificate Management System provides sample authentication plug-ins. You can find them in this directory:
You can register custom authentication manager plug-in modules by using the CMS window. Before registering a custom plug-in, be sure to put the Java class for the plug-in in the classes directory. For instructions, see "Registering an Authentication Plug-in Module".
After you have registered the custom authentication plug-in module, you must configure an instance of it. For instructions, see "Adding an Authentication Instance".
After you have created the authentication manager instance, you must customize the appropriate HTML form for end-entity enrollment. Make the following changes:
Update the enrollment forms to use the new authentication manager instance. This involves setting the value of authenticator, an HTML element in the enrollment form, to the name of the custom authentication manager instance.
where myAuthMgr is the name of the authentication instance you want to use with the enrollment form.
Figure 12.2 End-entity enrollment form for SSN and directory-based authentication