cURL / Mailing Lists / curl-library / Single Mail

curl-library

Customizing 401 handling for http-digest authentication

From: Guru Prasad <bgurup.ndk_at_gmail.com>
Date: Wed, 29 Oct 2014 19:29:42 +0530

Hello All,

I just want to check whether anyone has tried to provide GBA functionality
(Generic Bootstrapping Algorithm) in libcurl?

I have few questions w.r.t this. Please bare with me if this question is
too trivial or already discussed in this forum.

If I want to modify the 401 response handling for digest authentication,
can I do this in the header callback function registered with libcurl (with
CURLOPT_HEADERFUNCTION option)?

I am trying my best to put the question.
For example:
After getting 401 response from the server with the digest authentication,
I want to use these parameters for GBA (assuming GBA functionality is
provided by third party software) and then provide the digest response to
the server in the Authorization header. Here, basically, I am trying to
modify the 401 handling of libcurl with the GBA primitives. I request for
suggestions, here.

I have few questions in my mind regarding this.
Can I use CURLOPT_HTTPHEADER option for this with curl_slist? In this case,
do I have to take care of all the headers or can I add only partial headers
which are specific to GBA and rest of the headers will be provided by
libcurl as part of the 401 response handling. In this case, how the libcurl
gets the trigger to send the request with the customized Authorization
header? or how to hold libcurl not to send the response until the
customized header is formed as part of GBA procedure.

Any suggestions are welcome.

Thanks in advance.

Best Regards,
bgurup

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-10-29