Use the LDAP_CREATE_PROXYAUTH_CONTROL API or LDAP routine to create an LDAP control that allows a bind entity to assume a proxy identity.
#include ldap.h
int ldap_create_proxyauth_control(
LDAP *ld,
char *proxyDN,
int iscritical,
LDAPControl **controlp)
int ldap_proxy_dn_prefix(
char **proxyDN,
char *parm)
This API is used to create an LDAP control that contains the proxy authorization identity. The created proxy authorization control is then included in LDAP operations to request an operation from the server.
Using the proxy authorization control mechanism, a client can bind to the LDAP directory by using its own identity. But is granted proxy authorization rights of another user to access the target directory.
When the LDAP server receives an operation with proxy authorization control, the bind DN is validated against the administrative group or the predefined proxy authorization group. This validation is to determine whether the bind DN must be granted the proxy authorization right. In other words, the bound application client must be a member of the administrative group or proxy authorization group to request a proxy authorization operation.
LDAP_PARAM_ERROR returns if an invalid parameter was passed.
LDAP_NO_MEMORY returns if memory cannot be allocated.
LDAP_ENCODING_ERROR returns if an error occurred when you encode the control.
LDAP_UNAVAILABLE_CRITICAL_EXTENSION returns if server does not support proxy authorization and iscritical is set to a non-zero value.
ldap controls, ldap_bind, ldap_search, ldap_modify, ldap_delete, ldap_add