I am trying to do an HTTP GET to pull down webpages, parse and store data
into a MySQL DB.
However the pages are using digest auth as outlines in RFC2617.  I am unable
to generate the
correct MD5 hash from the following code for using MD5-sess:

        $realm = "[EMAIL PROTECTED]";
        $nonce = "dcd98b7102dd2f0e8b11d0f600bfb0c093";
        $opaque = "5ccc069c403ebaf9f0171e9517f40e41";
        $stale = "false";
        $qop = "auth";
        $alg = "MD5-sess";
        $cnonce = "0a4f113b";
        $uri = "/dir/index.html";
        $username = "Mufasa";
        $nc = "00000001";
        $pwd = "Circle Of Life";

        $auth_inf = "$username:$realm:$pwd";
        $h1 = md5($auth_info);
        $a1 = "$h1:$nonce:$cnonce";
        $ha1 = md5($a1);
        $a2 = "GET:$uri";
        $ha2 = md5($a2);
        $response = "$ha1:$nonce:$nc:$cnonce:$qop:$ha2";
        echo $response;
        $digest_resp = md5($response);

This is the example given in the RFC but the hash returns the incorrect
value and doesn't match the
one stated in the RFC paper.  Anyone else ever try this or know the correct
method of running the
hash for Digest Auth using MD5


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to