GNURLOPT_SASL_AUTHZID(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’– GNURLOPT_SASL_AUTHZID(3) πŸ’–

Okay bestie, welcome to the GNURLOPT_SASL_AUTHZID(3) page β€” you're in the curl_easy_setopt options manual, and this is the authorisation-identity era. ✨


🌸 NAME 🌸

CURLOPT_SASL_AUTHZID β€” authorisation identity (identity to act as). Yep, it's the "who am I acting as?" option, and it's giving main-character energy. πŸ’…

✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SASL_AUTHZID, char
*authzid);

πŸ’… DESCRIPTION πŸ’…

Pass a char * as the parameter, bestie. It should point at the null-terminated authorisation identity (authzid) for the transfer. This only applies to the PLAIN SASL authentication mechanism, where it's optional. 🫢

When it's not specified, only the authentication identity (authcid) as specified by the username gets sent to the server, along with the password. The server will derive an authzid from the authcid when it's not provided, and then it will use it internally. πŸŽ€

When the authzid is specified β€” and its use is server dependent β€” it can be used to access another user's inbox that the user has been granted access to, or a shared mailbox, for example. πŸ‘‘

πŸŽ€ DEFAULT πŸŽ€

blank β€” that's the default, no cap. πŸ’–

πŸ¦‹ PROTOCOLS πŸ¦‹

IMAP, POP3 and SMTP. Those are the vibes. πŸ’Œ

πŸ”₯ EXAMPLE πŸ”₯

CURL *curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "imap://example.com/");
  curl_easy_setopt(curl, CURLOPT_USERNAME, "Kurt");
  curl_easy_setopt(curl, CURLOPT_PASSWORD, "xipj3plmq");
  curl_easy_setopt(curl, CURLOPT_SASL_AUTHZID, "Ursel");
  ret = curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}

⭐ AVAILABILITY ⭐

Added in 7.66.0. Iconic. πŸ’«

🌈 RETURN VALUE 🌈

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. Simple as that, bestie. ⭐

πŸ‘‘ SEE ALSO πŸ‘‘

  • CURLOPT_USERNAME(3) β€” username reference, bestie.
  • CURLOPT_PASSWORD(3) β€” password reference, obviously.
  • .BRCURLOPT_USERPWD(3) β€” yes, that's the exact SEE ALSO string on this page; keep it exactly as written. πŸ’…

Later, bestie β€” this page is from libcurl 7.66.0, dated 11 Sep 2019. πŸ’–πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from