quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

CURLOPT_SASL_AUTHZID.md (1993B)


      1 ---
      2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
      3 SPDX-License-Identifier: curl
      4 Title: CURLOPT_SASL_AUTHZID
      5 Section: 3
      6 Source: libcurl
      7 See-also:
      8   - CURLOPT_PASSWORD (3)
      9   - CURLOPT_USERNAME (3)
     10   - CURLOPT_USERPWD (3)
     11 Protocol:
     12   - IMAP
     13 Added-in: 7.66.0
     14 ---
     15 
     16 # NAME
     17 
     18 CURLOPT_SASL_AUTHZID - authorization identity (identity to act as)
     19 
     20 # SYNOPSIS
     21 
     22 ~~~c
     23 #include <curl/curl.h>
     24 
     25 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SASL_AUTHZID, char *authzid);
     26 ~~~
     27 
     28 # DESCRIPTION
     29 
     30 Pass a char pointer as parameter, which should be pointing to the
     31 null-terminated authorization identity (*authzid*) for the transfer. Only
     32 applicable to the PLAIN SASL authentication mechanism where it is optional.
     33 
     34 When not specified only the authentication identity (*authcid*) as specified
     35 by the username is sent to the server, along with the password. The server
     36 derives a *authzid* from the *authcid* when not provided, which it then uses
     37 internally.
     38 
     39 When the *authzid* is specified, the use of which is server dependent, it can
     40 be used to access another user's inbox, that the user has been granted access
     41 to, or a shared mailbox for example.
     42 
     43 The application does not have to keep the string around after setting this
     44 option.
     45 
     46 Using this option multiple times makes the last set string override the
     47 previous ones. Set it to NULL to disable its use again.
     48 
     49 # DEFAULT
     50 
     51 blank
     52 
     53 # %PROTOCOLS%
     54 
     55 # EXAMPLE
     56 
     57 ~~~c
     58 int main(void)
     59 {
     60   CURL *curl = curl_easy_init();
     61   if(curl) {
     62     CURLcode res;
     63     curl_easy_setopt(curl, CURLOPT_URL, "imap://example.com/");
     64     curl_easy_setopt(curl, CURLOPT_USERNAME, "Kurt");
     65     curl_easy_setopt(curl, CURLOPT_PASSWORD, "xipj3plmq");
     66     curl_easy_setopt(curl, CURLOPT_SASL_AUTHZID, "Ursel");
     67     res = curl_easy_perform(curl);
     68     curl_easy_cleanup(curl);
     69   }
     70 }
     71 ~~~
     72 
     73 # %AVAILABILITY%
     74 
     75 # RETURN VALUE
     76 
     77 curl_easy_setopt(3) returns a CURLcode indicating success or error.
     78 
     79 CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
     80 libcurl-errors(3).