Format to add username and password to http request

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,448
Reaction score
47,588
Location
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.
 

DarkHelmet

Getting the hang of it
Joined
Feb 26, 2017
Messages
167
Reaction score
66
standard format for passing credentials in a URL is: http://USER:PASS@192.191.108.124:81
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,448
Reaction score
47,588
Location
USA
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.
 

DarkHelmet

Getting the hang of it
Joined
Feb 26, 2017
Messages
167
Reaction score
66
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?
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,448
Reaction score
47,588
Location
USA
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.
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,539
Reaction score
2,765
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
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,448
Reaction score
47,588
Location
USA
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...
 

DarkHelmet

Getting the hang of it
Joined
Feb 26, 2017
Messages
167
Reaction score
66
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 :\
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,539
Reaction score
2,765
Wasn't sure if you saw my edit above about trying wget.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,448
Reaction score
47,588
Location
USA
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 :(
 

TonyR

IPCT Contributor
Joined
Jul 15, 2014
Messages
16,458
Reaction score
38,185
Location
Alabama
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.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,448
Reaction score
47,588
Location
USA
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.
 
Top