mpromonet / webrtc-streamer

WebRTC streamer for V4L2 capture devices, RTSP sources and Screen Capture
https://webrtcstreamer.agreeabletree-365b9a90.canadacentral.azurecontainerapps.io/?layout=2x2
The Unlicense
2.8k stars 581 forks source link

Http Authorization Failed #634

Closed mjchow closed 6 months ago

mjchow commented 8 months ago

Hello, thank you for providing such a good project. I have a question now. I configured the content in password.txt, for example: test:127.0.0.1:123456. But when I browse 127.0.0.1:8000, it requires me to provide a username and password. When I enter test and 123456, the authentication fails. Can you please tell me what should I do?

mpromonet commented 8 months ago

Hi,

The description of the file format is https://github.com/civetweb/civetweb/blob/master/docs/UserManual.md#global_auth_file. You should not put the password in plain text but the md5 using your realm.

Best Regards, Michel.

mjchow commented 8 months ago

May I ask what is the generation rule for this password? MD5(password) or MD5(realm+password)? I have tried several options, but none of them were successful in HTTP authentication.

mpromonet commented 7 months ago

Hi, The realm is the authentification domain which is by default mydomain.com

echo user:mydomain.com:$(echo -n user:mydomain.com:password | md5sum | cut -d- -f1) > passwd 
webrtc-streamer -A passwd

Best Regards, Michel.