1--- 2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al. 3SPDX-License-Identifier: curl 4Title: CURLOPT_SASL_AUTHZID 5Section: 3 6Source: libcurl 7See-also: 8 - CURLOPT_PASSWORD (3) 9 - CURLOPT_USERNAME (3) 10 - CURLOPT_USERPWD (3) 11--- 12 13# NAME 14 15CURLOPT_SASL_AUTHZID - authorization identity (identity to act as) 16 17# SYNOPSIS 18 19~~~c 20#include <curl/curl.h> 21 22CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SASL_AUTHZID, char *authzid); 23~~~ 24 25# DESCRIPTION 26 27Pass a char pointer as parameter, which should be pointing to the 28null-terminated authorization identity (*authzid*) for the transfer. Only 29applicable to the PLAIN SASL authentication mechanism where it is optional. 30 31When not specified only the authentication identity (*authcid*) as 32specified by the username is sent to the server, along with the password. The 33server derives a *authzid* from the *authcid* when not provided, which 34it then uses internally. 35 36When the *authzid* is specified, the use of which is server dependent, it 37can be used to access another user's inbox, that the user has been granted 38access to, or a shared mailbox for example. 39 40# DEFAULT 41 42blank 43 44# PROTOCOLS 45 46IMAP, LDAP, POP3 and SMTP 47 48# EXAMPLE 49 50~~~c 51int main(void) 52{ 53 CURL *curl = curl_easy_init(); 54 if(curl) { 55 CURLcode res; 56 curl_easy_setopt(curl, CURLOPT_URL, "imap://example.com/"); 57 curl_easy_setopt(curl, CURLOPT_USERNAME, "Kurt"); 58 curl_easy_setopt(curl, CURLOPT_PASSWORD, "xipj3plmq"); 59 curl_easy_setopt(curl, CURLOPT_SASL_AUTHZID, "Ursel"); 60 res = curl_easy_perform(curl); 61 curl_easy_cleanup(curl); 62 } 63} 64~~~ 65 66# AVAILABILITY 67 68Added in 7.66.0. Support for OpenLDAP added in 7.82.0. 69 70# RETURN VALUE 71 72Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. 73