Example Of A Pre-Operation Bind Plug-In; Example Of A Pre-Operation Bind Function - Netscape DIRECTORY SERVER 6.01 - PLUG-IN Manual

Table of Contents

Advertisement

Note that if you do not register your SASL mechanism, the Directory Server will
send an
LDAP_AUTH_METHOD_NOT_SUPPORTED
will not call your pre-operation bind function.
NOTE
Be sure to check this source file for an example of a pre-operation
plug-in function for SASL authentication with LDAP bind operations:
<server_root>/plugins/slapd/slapi/examples/testsaslbind.c

Example of a Pre-Operation Bind Plug-In

The following sections document an example of a pre-operation bind plug-in that
handles authentication:

Example of a Pre-Operation Bind Function

Example of an Initialization Function
Registering the Plug-In
NOTE
Be sure to check this source file for an updated example of a
pre-operation plug-in function that handles authentication:
<server_root>/plugins/slapd/slapi/examples/testbind.c
Example of a Pre-Operation Bind Function
The following is an example of a pre-operation bind function that authenticates
clients and bypasses the default backend bind function. In this example, the
function just compares the client's credentials against the value of the
attribute for the entry.
userpassword
Code Example 8-1
#include <stdio.h>
#include <string.h>
#include "slapi-plugin.h"
/* Pre-operation plug-in function */
int
test_bind( Slapi_PBlock *pb )
{
char
*dn;
int
method, rc = LDAP_SUCCESS;
struct berval
struct berval
Slapi_PBlock
Sample Pre-Operation Bind Function
*credentials;
**pwvals;
*searchpb = NULL;
Chapter 8
Writing a Pre-Operation Bind Plug-in
result code back to the client and
Defining Functions for Authentication
101

Advertisement

Table of Contents
loading

This manual is also suitable for:

Directory server 6.01

Table of Contents