![Netscape NETSCAPE DIRECTORY SERVER 6.2 - GATEWAY CUSTOMIZATION Manual Download Page 104](http://html1.mh-extra.com/html/netscape/netscape-directory-server-6-2-gateway-customization/netscape-directory-server-6-2-gateway-customization_manual_1674642104.webp)
Writing a Pre-Operation Bind Plug-in
104
Netscape Directory Server Plug-In Programmer’s Guide • December 2003
Example of an Initialization Function
To initialize your plug-in, write an initialization function to do the following:
•
Call
slapi_pblock_set()
to set the
SLAPI_PLUGIN_PRE_BIND_FN
parameter
to the name of your pre-operation bind function. (For details, see “Registering
Your Plug-In Functions” on page 34.)
•
If you are using SASL as the authentication method, call the
Functions for
Syntax Plug-In
function to register your SASL mechanism with the Directory
Server.
The following is an example of an initialization function that registers the
pre-operation bind function.
break;
/* This plug-in does not support any other method of
authentication */
case LDAP_AUTH_SASL:
default:
slapi_log_error( SLAPI_LOG_PLUGIN, "test_bind",
"Unsupported authentication method requested: %d\n",
method );
rc = LDAP_AUTH_METHOD_NOT_SUPPORTED;
break;
}
if ( searchpb ) {
slapi_free_search_results_internal( searchpb );
slapi_ch_free( ( void ** )&searchpb );
}
slapi_send_ldap_result( pb, rc, NULL, NULL, 0, NULL );
return( 1 );
}
Code Example 8-2
Sample Function for Registering Pre-Operation Bind Function
#include <stdio.h>
#include <string.h>
#include "slapi-plugin.h"
Slapi_PluginDesc bindpdesc = { "test-bind", "Netscape", "0.5",
"sample bind pre-operation plugin" };
/* Initialization function */
#ifdef _WIN32
__declspec(dllexport)
#endif
int
testbind_init( Slapi_PBlock *pb )
{
Code Example 8-1
Sample Pre-Operation Bind Function (Continued)
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...