curl / Mailing Lists / curl-library / Single Mail

curl-library

Bearer token authentication?

From: John Hascall <john_at_iastate.edu>
Date: Fri, 2 Mar 2018 16:13:35 -0600

Has any thought been given to the possibility of something along these
lines:

curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BEARER);
curl_easy_setopt(curl, CURLOPT_BEARER_TOKEN, token);

   *or*
curl_easy_setopt(curl, CURLOPT_PASSWORD, token);

because faffing around in the struct curl_slist of headers to
​ ​
replace the "Authorization Bearer *token*" header every time you have
​ ​
a new token
(especially with short-lived tokens like at api.box.com)
​ ​
is annoying
​ (and
smells of an abstraction violation).

Or am I missing some sane way to do it?

John​

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-03-02