Hello,
we face a problem with public direct links, created via the OCS API.
Please help us.
Here is what we do
- We get a filelist like this: Basic APIs — Nextcloud latest Developer Manual latest documentation
PROPFIND remote.php/dav/files/user/path/to/folder
- with that we get a fileId, which we use to create a public direct link like this: OCS APIs overview — Nextcloud latest Developer Manual latest documentation
POST /ocs/v2.php/apps/dav/api/v1/direct
which gives us a nice proper public link, which works fine, when pasted into the browser address bar
Now here comes the issue
- We list those links as HTML links in our intranet.
- if we click on one link, a new tab opens and the file is shown or downloaded (depending on file type: pdf, md, odt)
- if we click a second time, we get a
HTTP ERROR 503
- if we click any other listed file, the error shows immediately
- we figured out, that 4 cookies are set in the web storage and as long as one specific cookie exists, the link will fail. We tested that by just deleting the one cookie “ocppvjk1lhdq”
Additional Information
- Nextcloud v 26.0.1
- the Nextcloud server is in a docker container, behind træfik and fail2ban
- we digged through the log files, and it seems to be no error on the PHP side, we are not sure though, if that plays a role here anyway
- The problem is not Browser specific, happens in Chrome and Firefox alike
- our Nextcloud enforces password in shared files, as well as expiration date
- we tried the share link api: OCS Share API — Nextcloud latest Developer Manual latest documentation but can’t use this approach for usability reasons (namely passwords have to be shared)