libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] Digest authentication: Stale nonce received


From: Mario Valle
Subject: [libmicrohttpd] Digest authentication: Stale nonce received
Date: Wed, 25 Nov 2015 21:03:18 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

Dear all,

I just started playing with MHD. With a few contortions, I'm able to use it on Windows. Very good! Thanks.

My final goal is to embed a server in my application with a modicum of authentication and very few requests per day :-)
So I opted for Digest authentication.
I started from digest_auth_example.c and added code to serve my html files and images (ie transplanting the example from the tutorial section 4).

The problem is that the browser (Chrome) is asking for username and password apparently for each loaded image of the page. Adding few printf to the digest_auth_example.c code gives:

> server.exe 8899
Before MHD_digest_auth_check
After MHD_digest_auth_check ret: 0
/// Perfect, the first time it asks for user/passwd
Before MHD_digest_auth_check
After MHD_digest_auth_check ret: 1
Continuing and loading url:  </index.html>
/// Perfect, it load the page.
/// Now the request for the first image on the page
Before MHD_digest_auth_check
Stale nonce received. If this happens a lot, you should probably increase the size of the nonce array.
After MHD_digest_auth_check ret: 0
/// Now the browser asks again for user/passwd. So I push cancel on the form

Well, I have increased the value of MHD_OPTION_NONCE_NC_SIZE from 300 to 50000 and nothing change, so seems the message is a red herring.

I'm deeply ignorant in these auth thingies, so I don't know if I blindly used the example that works for a single request or there is something more profound I'm missing.
All your help is highly appreciated. Thanks!
                                                        mario
--
Ing. Mario Valle
Swiss National Supercomputing Centre (CSCS)
v. Trevano 131, 6900 Lugano, Switzerland
Tel: +41 (91) 610.82.60



reply via email to

[Prev in Thread] Current Thread [Next in Thread]