CodeIgniter Forums
HTTP digest authentication with Phil Sturgeon's rest client failing - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: HTTP digest authentication with Phil Sturgeon's rest client failing (/showthread.php?tid=38488)



HTTP digest authentication with Phil Sturgeon's rest client failing - El Forum - 02-09-2011

[eluser]jpcody[/eluser]
Hey folks, this is almost certainly user error.

I'm trying to use Phil Sturgeon's HTTP client library in order to authenticate my app with an existing HTTP digest API. i don't seem to be able to get anything other than a 401, and I'm in a bit over my head.

I"ve been var_dumping left and right and can't seem to find the info I'm looking for. Here's my most basic code, which I can't get past.

Code:
$this->load->library('rest', array(
           'server' => 'base_url_to_api_server',
           'http_user' => md5('user_id_here'),
           'http_pass' => md5('user_pass_here'),
           'http_auth' => 'digest'
        ));
        
        $response = $this->rest->get($api_url);
        
        echo $response;

But all I'm getting is a 401. I'm expecting some sort of challenge back from the server, from which I can construct a response and try another GET.

Am i just on another planet?