The sample $INSTALL_DIR/plugins/slapd/slapi/examples/testsaslbind.c plug-in demonstrates the use of this function.