I have my own dashboard on a tablet at home which displays random photos from owncloud. Dashboard has server and client side. Server-side gets all images from selected folders from webdav using xhr request (PROPFIND
method). Client-side asks server for a list of images and embeds <img>
tag with a random link.
As you need to authenticate with webdav on client-side, I used HTTP auth via user:pass
directly in a link: login:pass@example.com/remote.php/webdav/photos/DSC03599.JPG
. But as of Chrome 59, this feature was removed and now I get an error (blocked:origin)
.
What options do I see now:
- Make an xhr request, get its contents as
data:uri
and insert assrc
of the image:<img src="data:image/...">
. - Create some type of proxy on server side. I will ask it for an image url, it will make a request to owncloud with appropriate HTTP Auth headers and return response to client.
Both ways seem too complicated for me. I want something like:
- This IP has an access to view any image in ownCloud.
or - ownCloud generates some token, which I simply add to each image request, like: https://login:pass@example.com/remote.php/webdav/photos//DSC03599.JPG?token=xxx
Any suggestion?