Table of Contents | Previous | Next | Index

Netscape Directory SDK 3.0 for C Programmer’s Guide
     Chapter 18 Functions

ldap_sasl_bind_s()

Authenticates your client to an LDAP server synchronously using an SASL (Simple Authentication and Security Layer) mechanism. The LDAP server must support that SASL mechanism for authentication.

Syntax

#include <ldap.h>
int ldap_sasl_bind_s( LDAP *ld, const char *dn,
   const char *mechanism, struct berval *cred,
   LDAPControl **serverctrls, LDAPControl **clientctrls,
   struct berval **servercredp );

Parameters

This function has the following parameters:

ld

Connection handle, which is a pointer to an LDAP structure containing information about the connection to the LDAP server.

dn

Distinguished name (DN) of the user who wants to authenticate. For anonymous authentication, set this to NULL.

mechanism

Name of the SASL mechanism that you want to use for authentication.

cred

Pointer to the berval structure containing the credentials that you want to use for authentication.

serverctrls

Pointer to an array of LDAPControl structures representing LDAP server controls that apply to this LDAP operation. If you do not want to pass any server controls, specify NULL for this argument.

clientctrls

Pointer to an array of LDAPControl structures representing LDAP client controls that apply to this LDAP operation. If you do not want to pass any client controls, specify NULL for this argument.

servercredp

Pointer to a pointer to an berval structure containing any credentials returned by the server.

When done, you can free this by calling the ber_bvfree() function.

Returns

One of the following values:

The following result codes can be returned by the Netscape Directory Server when processing an LDAP SASL bind request. Other LDAP servers may send these result codes under different circumstances or may send different result codes back to your LDAP client.

Note that the Netscape Directory Server may send other result codes in addition to the codes described here (for example, LDAP_NO_SUCH_OBJECT if the DN in the original bind request does not exist or LDAP_INVALID_CREDENTIALS if the credentials in the original bind request were incorrect). In the Netscape Directory Server, the people deploying the server are responsible for implementing the authentication mechanisms for SASL authentication. Check with your server administrator for additional result codes returned to the client.

Description

The ldap_sasl_bind_s() function authenticates your client to an LDAP server by using a specified SASL mechanism. The LDAP server must support authentication through that SASL mechanism. (The Netscape Directory Server 3.0 supports a server plug-in interface that you can use to add SASL support to the server. For details, see the Netscape Directory Server 3.0 Programmer's Guide.)

After authenticating a client through SASL, an LDAP server can return a set of credentials in the results. The servercredp argument points to this value.

ldap_sasl_bind_s() is a synchronous function, which directly returns the results of the operation. If you want to perform other operations while waiting for the results of this operation, call the asynchronous function ldap_sasl_bind() instead. (For more information on asynchronous and synchronous functions, see "Calling Synchronous and Asynchronous Functions" on page 80.)

For additional information on authenticating through SASL mechanisms, see Chapter 13, "Using SASL Authentication".

See Also

ldap_sasl_bind().


Table of Contents | Previous | Next | Index

Last Updated: 10/01/98 17:06:23