cam2web icon indicating copy to clipboard operation
cam2web copied to clipboard

URL with credentials

Open frakman1 opened this issue 6 years ago • 4 comments

Hi Andrew,

Thanks for making an awesome and useful utility like this.

After adding User Access Control, I would like to know what URL format to use that allows me to pass in the username and password directly without having to enter them in the popup. I've tried these variations without any luck:

http://myuser:mypassword@ip:port/camera/mjpeg and http://ip:port/camera/mjpeg&u=myuser&p=mypassword

Any idea if this is possible or not?

frakman1 avatar Feb 24 '19 15:02 frakman1

Hello,

This is not possible at this point. Some code changes need to be done to support it.

cam2web uses Digest authentication instead of Basic. With Basic authentication you would be allowed to send user name/password in plain as you would like. However in Digest authentication a hash function is applied to password, so it is not send in clear.

https://en.wikipedia.org/wiki/Basic_access_authentication https://en.wikipedia.org/wiki/Digest_access_authentication

May need to see what can be done. The best might be to default to Digest, but accept Basic as well if user chose to use it. If not, maybe a configuration option could be used.

andrewkirillov avatar Feb 25 '19 10:02 andrewkirillov

Just an update. Windows version was updated about 2 months ago to support Basic authentication, so user/password can be put into URL.

cvsandbox avatar Nov 08 '19 09:11 cvsandbox

Fantastic! Can you provide example syntax please?

frakman1 avatar Nov 08 '19 14:11 frakman1

As you mentioned it before: http://myuser:mypassword@ip:port/camera/mjpeg or to access Web UI http://myuser:mypassword@ip:port

I did not make an official buid. If you are happy to get latest code and build it, then you can test it quickly. Otherwise I can make a build.

The new version should accept both Digest and Basic authentication. However in configuration UI, there is an option to specify default method, which is requested from clients which are not yet authenticated.

cvsandbox avatar Nov 08 '19 14:11 cvsandbox