PHP Digest Authentication - page is not passing username and password #160
Replies: 2 comments
-
It is likely that the devices don't accept the username and password properties. have you found a solution to your problem? I am currently dealing with the same issue |
Beta Was this translation helpful? Give feedback.
0 replies
-
Related link: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to write a simple php page that auto loads a camera stream in an iframe. The page is working except it is still asking me for a username and password and I'm not sure why these aren't being passed to the camera. I have tried this multiple ways and get the same result. Here is one of the code examples:
<?php // Set up login credentials $username = "root"; $password = "password"; // Set up camera IP and resolution $camera_ip = "192.168.1.5"; $resolution = "320x240"; // Build the video feed URL $video_feed_url = "http://$camera_ip/axis-cgi/mjpg/video.cgi?resolution=$resolution"; // Set up digest authentication $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $video_feed_url); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); curl_setopt($ch, CURLOPT_USERPWD, "$username:$password"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); // Create the iframe echo "<iframe src='$video_feed_url' width='320' height='240' frameborder='0'></iframe>"; ?>
Beta Was this translation helpful? Give feedback.
All reactions