Setup an HTTP to Authenticate over Digest Server


#1

Hi there, I’m trying to implement HTTP Digest Authentication, but I’m having troubles to login over the Web Service that supports Digest. I always get Unauthorized from the server.

This is what i got in the client;

        $http = new HttpSocket();
        $http->configAuth('Digest', array(
            'user' => 'myUser',
            'pass' => '22da9adc05daf39df4d813d9ac227337',
        ));

        $q = $http->post(
                $url, json_encode($data)
        );

And this is what i got at appController.php in the webservice side;

public $components = array(
    'Session',
    'RequestHandler',
    'Security' => array(
    //'blackHoleCallback' => 'forceSSL'
    ),
    'Auth' => array(
        'authenticate' => array(
            'Digest' => array(
                'userModel' => 'User',
                'fields' => array('username' => 'username', 'password' => 'digest_hash')
            )
        ),
    //'authorize' => 'Controller'
    )
);

When I access the webservice url locally it prompts me for username and password and I put it and it works, it gives me access, but when I do it via HTTP it prevents me

Regards…