Repository navigation
Description
Describe the bug
When attempting to download multiple files (which triggers the Archiver/ZIP download) via a Public Link shared from a Project Space, the request fails with 401 Unauthorized. Single-file downloads from the same link work correctly. Public links shared from Personal folders (User-owned) allow multi-file downloads without issue.
Steps to reproduce
- Create a "Project Space" (Type 8).
- Create a Public Link for a folder within this Space (allow download).
- Open the Public Link in an incognito browser window.
- Select multiple files.
- Click "Download" (to trigger the ZIP generation).
- Result: The browser receives a 401 Unauthorized response. The ZIP download fails.
Expected behavior
The Archiver service should correctly validate the signed URL for Space-owned resources and serve the ZIP file, just as it does for Personal resources.
Actual behavior
The request to /archiver returns 401. Server logs indicate a "User not found" error during the signed_url authentication phase.
Setup
Started via Docker Compose with OIDC (Keycloak).
Details
services:
ocis:
image: owncloud/ocis:7.3.1
environment:
OCIS_URL: https://ocis.example.com
PROXY_AUTOPROVISION_ACCOUNTS: "true"
PROXY_USER_OIDC_CLAIM: "preferred_username"
PROXY_USER_CS3_CLAIM: "username"
OCIS_JWT_SECRET: "..."Additional context
Environment:
OCIS Version: 7.3.1 (Compiled: 2025-11-25)
OS: Linux
Log Analysis & Hypothesis: We compared logs between a successful Personal download and a failed Space download.
Failed Request (Space Public Link): The signed_url authenticator attempts to resolve the user associated with the claim (likely sub). It extracts the Space ID (Resource Owner) and attempts to look it up in the User Provider. Since the ID belongs to a Space (Type 8), not a User (Type 1), the lookup fails (Could not get user by claim).
{"level":"debug","service":"proxy","authenticator":"signed_url","message":"rewrite hook found"}
{"level":"error","service":"proxy","error":"user not found","message":"Could not get user by claim"}
{"level":"info","service":"proxy","status":401,"path":"/archiver"}
Successful Request (Personal Public Link): For personal folders, the Resource Owner is a User. The lookup succeeds, and authentication passes.
The issue appears to be that the Archiver service incorrectly assumes the resource owner in the signed token is always a User, causing failure for Space-owned resources.
Activity
[-]Bug Report: Public Link Multi-file Download (Archiver) fails with 401 for Project Spaces[/-][+]Public Link Multi-file Download (Archiver) fails with 401 for Project Spaces[/+]kobergj commentedon Jan 28, 2026
@smallkai thanks, seems I can reproduce this. Can you confirm this is only happening when using a password on the link? I think archiver doesn't play well with password-protected links. Needs investigation.
smallkai commentedon Jan 29, 2026
Hi @kobergj , thanks for the update. I've just confirmed that the issue is indeed related to the password protection. After removing the password from the link, everything works as expected. Let me know if you need any more logs for the investigation!
[-]Public Link Multi-file Download (Archiver) fails with 401 for Project Spaces[/-][+][OCISDEV-617] Public Link Multi-file Download (Archiver) fails with 401 for Project Spaces[/+]jvillafanez commentedon Jan 29, 2026
I think we'll need to discuss how to solve this...
It seems web is using a signed URL for the download, which contains the authentication. However, the signed URL should be used for impersonation (I think), so it requires a valid existing user.
The problem is that web is using "public" as user, but such user doesn't exists in the system.
I'm not sure how many of the following solutions are really viable:
Is it possible for web to generate a signed URL based on the user who created the share link, or the user who copies the link in oCIS? That might work, although we might expose the account to the outside.
kobergj commentedon Jan 30, 2026
@jvillafanez in the basic auth header you mean? Isn't that used to signal the password for the public link? Are you sure this is used as the username in the backend?
jvillafanez commentedon Jan 30, 2026
There is an
OC-Credential=publicin the URL, as shown in the image, and the error coming from the logs points to the signed_url_auth file. The user provider, whatever it is, fails to find that "public" user.From what I understand, web is using a signed URL to download the archive (https://github.com/owncloud/web/blob/0ac444b5642ba004ae9e05439eebe56a8f29e730/packages/web-pkg/src/services/archiver.ts#L86-L96) which doesn't contain basic auth. This works fine if the user exists.
I'm not sure if web (or any other client) should be able to generate a signed URL with a user that doesn't exists. Either we have a missing check in the signed URL generation in order to prevent this situation from happening, or we have a missing check to allow this "public" user go through the signed URL authentication.
2403905 commentedon Feb 12, 2026
I will add the context of why the UI switched to use the signing-key for a public link with passwords:
#11576
The signing-key endpoint returns the owner userId for the personal space. It works, but looks wrong in a public link context.
For the project space, the endpoint returns the spaceId instead of the userId
We should change or have another signing-key endpoint for signing the public links
2403905 commentedon Feb 13, 2026
I discovered that the download works if I use the signature from the PROPFIND
https://localhost:9200/archiver?public-token=FCVVQpllIorMVND&id=<id>&id=<id>&signature=<signature>&expiration=<date>2403905 commentedon Feb 13, 2026
The signature & expiration we can get from the PROPFIND oc:downloadURL. The problem is the PROPFIND doesn't have downloadURL for the folders.
2403905 commentedon Feb 13, 2026
UPD. The steps to fix.
#12017
<oc:signature-auth/>to the propfind request to get the signature and expirationhttps://localhost:9200/archiver?public-token=FCVVQpllIorMVND&id=<id>&id=<id>&signature=<signature>&expiration=<date>LukasHirt commentedon Feb 13, 2026
Web PR to use the signature auth: owncloud/web#13576
@2403905 this however introduces a bit of an edge case. The expiration of the signature seems to be one hour. That means that if someone leaves the client opened for over an hour without going to any other page/folder and tries to download an archive afterwards, it will still fail.
2403905 commentedon Feb 18, 2026
@nirajacharya2 Could you add the test case?