http digest authentication
Hello,
I use the WebClient example in S60 3rd FP2 SDK to access a server which needs digest authentication. I am sure the username and password are correct but it keeps failing to pass the authentication. I capture the packet sent from client and found there are actually response field included. I make a calculation with MD5 and check that the value is correct. Why did the server keep rejecting?
Best regards,
Toby
Re: http digest authentication
You may attempt reproducing the issue manually, using telnet. Of course it requires the server to tolerate your slowness, but at least it is something to try.
If you are already in capturing packets, you could capture what others are sending (like the browser on the device or on your PC), and of course check if they succeed actually.
Re: http digest authentication
Thanks for your reply first. After serveral tries, I found that this problem even occurs on native broswer of the device or simulator. The server is running properly since I can pass the authentication with the browser of my PC. I am wondering whether it is the problem of nokia HTTP class. The device just send the correct response code to server but it keeps failing to authenticate. The following is the captured packet.
GET /view/viewer_index.shtml?id=66 HTTP/1.1
Host: 192.168.1.183
Accept: text/html,text/css,multipart/mixed,application/java-archive, application/java, application/x-java-archive, text/vnd.sun.j2me.app-descriptor, application/vnd.oma.drm.message, application/vnd.oma.drm.content, application/vnd.oma.dd+xml, application/vnd.oma.drm.rights+xml, application/vnd.oma.drm.rights+wbxml, application/x-nokia-widget, */*
Accept-Charset: iso-8859-1, utf-8; q=0.7, *; q=0.7
Accept-Encoding: gzip, deflate, x-gzip, identity; q=0.9
Accept-Language: en
Authorization: Digest username="root", realm="AXIS_00408CA63BAD", nonce="00023df0Y80168093a5520479ab11bf0ee4b6dc5f74521", response="02d06b9f40b7df2c5dc5f1404b971282", uri=/view/viewer_index.shtml?id=66, qop="auth", cnonce="cd1cab6607c177753729384596c35608", nc=00000001
User-Agent: Mozilla/5.0 (SymbianOS/9.2; U; [en]; Series60/3.2 Nokia3250/1.00; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413
x-wap-profile: "http://nds1.nds.nokia.com/uaprof/N3250r100.xml"
Re: http digest authentication
I found where the problem is but I dont know why. The parameter cnonce used in Authorization which is a random number generated by symbian device is 32 bytes long, however I noticed the cnonce generated by the browser of my PC was 16 bytes long. I tried manually add the authorization field with16 byte long cnonce parameter and it worked. Perhaps the server doesnt accept cnonce longer than 16bytes? Or can I do something to change the length of the cnonce if I want to use the built in Digest authentication function?
Re: http digest authentication
If you check the related RFC, you will see that the definition is "cnonce-value = nonce-value", where "nonce-value = quoted-string", so it could be anything. It is a problem with the server if it really has a limitation, and especially if it is such a low character count.
Re: http digest authentication