Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Add support for HTTP Basic Auth credentials to Classic Webcam snapshot camera #5016

Open
1 of 4 tasks
mikeb9x opened this issue May 17, 2024 · 3 comments
Open
1 of 4 tasks
Labels
done Done but not yet released request Feature request
Milestone

Comments

@mikeb9x
Copy link

mikeb9x commented May 17, 2024

The problem

OctoPrint can't access snapshot URL from IP camera. Test shows "Snapshot test failed / Could not retrieve snapshot URL, please double check the URL". Stream works well.

Config:
Stream URL: http://user:password@X.X.X.X/mjpg/video.mjpg [accessible through browser]
Snapshot URL: http://user:password@X.X.X.X/jpg/1/image.jpg [accessible through browser]
image
'Validate SSL' option makes no difference.

Did the issue persist even in safe mode?

Yes, it did persist

If you could not test in safe mode, please state why ("currently printing" is NOT an excuse!)

No response

Version of OctoPrint

1.10.1

Operating system running OctoPrint

OctoPi* 1.0.0 (build 2024.04.25.094544)

Printer model & used firmware incl. version

No response

Browser and version of browser, operating system running browser

Chrome/Firefox

Checklist of files to include below

  • Systeminfo Bundle (always include!)
  • Contents of the JavaScript browser console (always include in cases of issues with the user interface)
  • Screenshots and/or videos showing the problem (always include in case of issues with the user interface)
  • GCODE file with which to reproduce (always include in case of issues with GCODE analysis or printing behaviour)

Additional information & file uploads

No response

@github-actions github-actions bot added the triage This issue needs triage label May 17, 2024
@foosel
Copy link
Member

foosel commented May 21, 2024

You haven't provided a system info bundle, which includes logs which are really crucial here. But based on the URLs you shared, I'm going to assume the problem here is that your username@password syntax simply is deprecated and not supported by the underlying Python library used for fetching the snapshot. Tbh, I'm kinda surprised the Stream URL works in your browser in 2024.

See also the corresponding section in RFC3986.

However, that means that we need some way to provide Basic Authentication credentials for the snapshot URL, so this just turned into a Feature Request.

@foosel foosel changed the title Unable to retrieve snapshots from IP camera (accessible through browser). Stream works well. [Request] Add support for HTTP Basic Auth credentials to Classic Webcam snapshot camera May 21, 2024
@github-actions github-actions bot added request Feature request and removed triage This issue needs triage labels May 21, 2024
@foosel foosel added this to the 1.11.0 milestone May 21, 2024
@mikeb9x
Copy link
Author

mikeb9x commented May 21, 2024

I can't provide logs because my SD card died and I'm waiting for a new one (32GB). For some reason I can't use my 64/128GB cards because I'm having partitioning issue at the first boot.
Stream in OctoPrint was working well despite having the same basic authentication. Problem was only with the snapshots.
In Firefox I need to confirm login (You are about to log in to the site “X.X.X.X” with the username “user”.), Chrome just starts the stream/shows snapshot.

@foosel
Copy link
Member

foosel commented May 21, 2024

Basic, Digest and Bearer auth will be supported from 1.11.0 onward via new options in the Classic Webcam settings.

image

Additionally, if you configure a snapshot URL with the deprecated in-URL credentials, OctoPrint will warn you about that and refer you to the advanced options containing the authentication settings.

@foosel foosel added the done Done but not yet released label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done Done but not yet released request Feature request
Projects
Status: Done
Development

No branches or pull requests

2 participants