rockyjvec / Onvif

PHP Onvif library for IP cameras.
20 stars 15 forks source link

The action requested requires authorization and the sender is not authorized #6

Open asterissco opened 2 years ago

asterissco commented 2 years ago

Hello, I try to use inside Laravel project and always return this message. The camera is a PTZ Hikvision and works fine with PYTHON ONVIF R resource

$o = new \Rockyjvec\Onvif\Onvif("http://".$session->camera->host.":".$session->camera->port."/onvif/device_service", $session->camera->onvif_user, $session->camera->onvif_pass);            

print_r($o->media->GetProfiles());

Output

{
    "status": "error",
    "code": 500,
    "time": 1642591673,
    "data": {
        "line": 61,
        "file": "...../vendor/rockyjvec/onvif/src/Rockyjvec/Onvif/Soap/SoapClient.php",
        "message": "The action requested requires authorization and the sender is not authorized",
        "type": "Exception"
    }
}

Thanks!

davidcopano commented 2 years ago

The same thing happens to me, but when I try to get the recordings from the camera, with this code:

$onvif->recording->GetRecordings()