![Netscape NETSCAPE DIRECTORY SERVER 6.2 - GATEWAY CUSTOMIZATION Manual Download Page 105](http://html1.mh-extra.com/html/netscape/netscape-directory-server-6-2-gateway-customization/netscape-directory-server-6-2-gateway-customization_manual_1674642105.webp)
Writing a Pre-Operation Bind Plug-in
Chapter
8
Defining Functions for Authentication
105
Registering the Plug-In
To register the plug-in, follow the instructions appropriate for the Directory Server
you’re using:
•
In Directory Server 4.x, add the
plugin preoperation
directive to the end of
the
slapd.ldbm.conf
file, which is located in the
<server_root>/slapd-<instance_id>/config
directory:
plugin preoperation on “my preop plugin”
/<server_root>/plugins/slapd/slapi/examples/libtest-plugin.so
testauth_init
Note that each pre-operation and post-operation plug-in is associated with a
backend. Make sure that the
plugin
directive that registers the plug-in is
within the database section for that back-end in the server configuration file.
(The
plugin
directive should be added somewhere after the
database
directive.)
•
In Directory Server 6.x, add this to the end of the
dse.ldif
file, which is
located in the
<server_root>/slapd-<instance_id>/config
directory:
dn: cn=Test Bind,cn=plugins,cn=config
objectClass: top
objectClass: nsSlapdPlugin
objectClass: extensibleObject
cn: Test Bind
nsslapd-pluginPath:
<server_root>/plugins/slapd/slapi/examples/libtest-plugin.so
nsslapd-pluginInitfunc: testbind_init
/* Register the pre-operation bind function and specify
the server plug-in version. */
if ( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION,
SLAPI_PLUGIN_VERSION_01 ) != 0 ||
slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION,
(void *)&bindpdesc ) != 0 ||
slapi_pblock_set( pb, SLAPI_PLUGIN_PRE_BIND_FN,
(void *) test_bind ) != 0 ) {
slapi_log_error( SLAPI_LOG_PLUGIN, "testbind_init",
"Failed to set version and function\n" );
return( -1 );
}
return( 0 );
}
Code Example 8-2
Sample Function for Registering Pre-Operation Bind Function
Summary of Contents for NETSCAPE DIRECTORY SERVER 6.2 - GATEWAY CUSTOMIZATION
Page 1: ...Plug In Programmer s Guide Netscape Directory Server Version6 2 December 2003...
Page 18: ...18 Netscape Directory Server Plug In Programmer s Guide December 2003...
Page 56: ...56 Netscape Directory Server Plug In Programmer s Guide December 2003...
Page 112: ...112 Netscape Directory Server Plug In Programmer s Guide December 2003...
Page 168: ...Plug In API Reference 168 Netscape Directory Server Plug In Programmer s Guide December 2003...
Page 170: ...170 Netscape Directory Server Plug In Programmer s Guide December 2003...
Page 600: ...600 Netscape Directory Server Plug In Programmer s Guide December 2003...
Page 612: ...612 Netscape Directory Server Plug In Programmer s Guide December 2003...