Format to add username and password to http request

wittaj

IPCT Contributor
Apr 28, 2019
30,972
59,392
USA
So I am trying to send a web request to the camera on an alert. The alert fires and changes the camera setting if I have the camera GUI up and running, but doesn't fire if I do not have the camera GUI up and running. I would prefer to not have the camera GUI up and running, plus then it wouldn't work if the computer reboots pr the GUI times out.

I am trying to figure out if there is a way to send web request on alert that would "login" the camera or how to add the username and password to my web request.

When you set-up a camera in BI, under the Find/Inspect option, it is sending a command to the camera to find the camera.

So for this camera it starts out as:

Opening 192.191.108.124 port 81...
HTTP Get / request...
OK
ONVIF GetSystemDateAndTime
2020-07-01T12:50:39.000Z
Requesting device information...

So is there is a command that "logs in" to the camera as shown by the "Opening 192.191.108.124 port 81..." I guess what is the syntax for the ...

I have tried:
192.191.108.124:81/USER.PWD
192.191.108.124:81/USER=xxxxx&PW=xxxxx
192.191.108.124:81/USERNAME=xxxxx&PWD=xxxxx
192.191.108.124:81/USER=xxxxx&PASSWORD=xxxxx
192.191.108.124:81/USERNAME=xxxxx&PASSWORD=xxxxx

Or better yet how to add it to the web request string of the command I am trying to do.
 
standard format for passing credentials in a URL is: http://USER:PASS@192.191.108.124:81
 
standard format for passing credentials in a URL is: http://USER:PASS@192.191.108.124:81

Unfortunately I guess this cheap cam doesn't follow standard format as I am getting an error. It says windows cannot find the device.
 
Unfortunately I guess this cheap cam doesn't follow standard format as I am getting an error. It says windows cannot find the device.
not being able to find the device sounds like a different error. if it was a credential problem, youd likely get access denied, or some such. sure you have the right port? tried without entering a port?
 
not being able to find the device sounds like a different error. if it was a credential problem, youd likely get access denied, or some such. sure you have the right port? tried without entering a port?

Yep, confirmed the correct port in the GUI settings.

If I take the user: password@ off and use just the IP: port it goes to the login screen.
 
There is no API that you know of for this camera brand?

If you have access to Linux then how about wget? Something like this:
wget --user user --pass pass xxx.xxx.xxx.xxx:xx
 
There is no API that you know of for this camera brand?

None that I can find. The vendor did get back to me and claimed you cannot call up shutter speed that way, yet I am doing it...so clearly a case of they don't know what they are selling LOL. Unfortunately, it will only work if the GUI is logged into...
 
None that I can find. The vendor did get back to me and claimed you cannot call up shutter speed that way, yet I am doing it...so clearly a case of they don't know what they are selling LOL. Unfortunately, it will only work if the GUI is logged into...
when you login via the web GUI, try opening Chromes developer tools and go to the network tab. see if it will reveal how it is passing the credentials. outside of that, no idea :\
 
What about setting up user "anonymous" in the camera?
 
when you login via the web GUI, try opening Chromes developer tools and go to the network tab. see if it will reveal how it is passing the credentials. outside of that, no idea :\

I will try that next - I was using Exployer and the Search Element feature to try to abstract that, so maybe Chrome will provide something useful.

What about setting up user "anonymous" in the camera?

Would I set up "anonymous" as a user name and then password would be? Surprisingly this doesn't let you have a blank password.

Wasn't sure if you saw my edit above about trying wget.

Unfortunately I do not have access to Linux :(
 
Would I set up "anonymous" as a user name and then password would be? Surprisingly this doesn't let you have a blank password.
I have a couple of Amcrests (re-branded Dahuas) that allow user "anonymous" and no username or password is required: put in IP in URL of browser, hit <Enter> and up pops cam's webGUI.

EDIT: user"anonymous" is already populated in config settings, one enables that user with a check box.
 
Bummer - this camera doesn't have "anonymous" as an option.

What is does have is:

Dev Authentication (Whether authentication is needed at login page)
  • Disable
  • Basic
  • Digest
I selected Disable and that does allow it to login without a user/PW - but it still requires one to hit the enter button to login, so unfortunately the webrequest without the GUI up and running still doesn't work.

Maybe getting closer. Let me look at the Chrome option now.
 
  • Like
Reactions: TonyR