If you are call the
ldap_sasl_bind()
function to get the result of the authentication attempt:
LDAP_API(int) LDAP_CALL ldap_result( LDAP *ld, int msgid, \
int all, struct timeval *timeout, LDAPMessage **result );
The parameters are described below:
•
is the connection handle, which is a pointer to the LDAP structure
ld
containing information about the connection to the LDAP server.
•
is the message ID returned as the last argument of the
msgid
ldap_sasl_bind()
•
applies to LDAP search operations. Since this is not an LDAP search
all
operation, you can pass NULL for this argument.
•
is the maximum interval to wait for the selection to complete. If
timeout
is a NULL pointer, the select blocks indefinitely. To effect a poll, the
timeout
parameter should be a non-NULL pointer, pointing to a zero-valued
timeout
structure.
timeval
•
is a pointer to an
result
bind operation. You need to pass this to the
ldap_parse_sasl_bind_result()
After calling
ldap_result()
ldap_parse_sasl_bind_result()
LDAP result code and any credentials returned by the server:
LDAP_API(int) LDAP_CALL ldap_parse_sasl_bind_result( LDAP *ld,
\
LDAPMessage *res, struct berval **servercredp, int freeit);
The parameters are described below:
•
is the connection handle, which is a pointer to the LDAP structure
ld
containing information about the connection to the LDAP server.
•
is a pointer to the
res
want to parse.
•
is a pointer to a pointer to the
servercredp
credentials returned by the server. These are the credentials that you set as the
value of the
SLAPI_BIND_RET_SASLCREDS
bind plug-in function.
ecifies whether the result (the
•
freeit sp
freed after the error code is extracted. If
the result is freed.
function, you need to call the
function.
structure containing the results of the
LDAPMessage
function.
, you need to call the
function to parse the results and retrieve the
structure containing the results that you
LDAPMessage
LDAPMessage
0
Chapter 8
Using SASL with an LDAP Client
structure containing any
berval
parameter in your pre-operation
structure) should be
, the result is not freed. If non-zero,
Defining Functions for Authentication
ldap_result()
115