Via OCS API shares don't appear in destination account and duplicate destination users listed
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- Nextcloud Server is running on 64bit capable CPU, PHP and OS.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
My application supports NextCloud storage with its features. I login users with authFlowV2, simply get appPassword and use it in next requests via basicAuth. But whenever I try to share file with other account something veird happens: I can see share appearing in native NextCloud UI (proper username, permissions, everything is ok), but file doesnt appear in collaborators account. Further more I can share tjis file from native UI and then you see 2 same users in collaborators tab. See attached screenshot

In my application I send all the same data as the native client, but result is different (the only differ is that i use appPassword for fileowner)
Steps to reproduce
- login user with login flow v2, get appPassword (artemTest01)
- share file to other user (artemTest02)
curl --location --request POST 'http://nextcloud.dev.graebert.com/ocs/v2.php/apps/files_sharing/api/v1/shares?format=json' --header 'OCS-APIREQUEST: true' --header 'Authorization: Basic YXJ0ZW1UZXN0MDM6NXkyR0VGNFhnR0ozODNPZk01cE1MSzFRUHRNbDdGUE84U2JJMk9YdERBOWVudjBTOUpqWk5ya3BKa1dTQ01hNXlybjVnUW9B' --header 'Content-Type: application/json' --data-raw '{"attributes":"[]","password":null,"path":"/new dwg test (copy 2).dwg","permissions":19,"shareType":0,"shareWith":"artemtest02"}'
- After you will see user in collaborators, but he wont get the file
- Untill you add him manually, and see 2 same users
Expected behavior
Object should be shared properly
Installation method
Community Docker image
Operating system
Debian/Ubuntu
PHP engine version
None
Web server
Apache (supported)
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
No response
List of activated Apps
Enabled:
- activity: 2.17.0
- bruteforcesettings: 2.5.0
- circles: 25.0.0
- cloud_federation_api: 1.8.0
- comments: 1.15.0
- contactsinteraction: 1.6.0
- dashboard: 7.5.0
- dav: 1.24.0
- federatedfilesharing: 1.15.0
- federation: 1.15.0
- files: 1.20.1
- files_pdfviewer: 2.6.0
- files_rightclick: 1.4.0
- files_sharing: 1.17.0
- files_trashbin: 1.15.0
- files_versions: 1.18.0
- firstrunwizard: 2.14.0
- logreader: 2.10.0
- lookup_server_connector: 1.13.0
- nextcloud_announcements: 1.14.0
- notifications: 2.13.1
- oauth2: 1.13.0
- password_policy: 1.15.0
- photos: 2.0.1
- privacy: 1.9.0
- provisioning_api: 1.15.0
- recommendations: 1.4.0
- related_resources: 1.0.3
- serverinfo: 1.15.0
- settings: 1.7.0
- sharebymail: 1.15.0
- support: 1.8.0
- survey_client: 1.13.0
- systemtags: 1.15.0
- text: 3.6.0
- theming: 2.0.1
- twofactor_backupcodes: 1.14.0
- updatenotification: 1.15.0
- user_status: 1.5.0
- viewer: 1.9.0
- weather_status: 1.5.0
- workflowengine: 2.7.0
Disabled:
- admin_audit
- encryption
- files_external
- suspicious_login
- twofactor_totp
- user_ldap
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the POST request to the OCS shares endpoint /ocs/v2.php/apps/files_sharing/api/v1/shares?format=json, comparing the app-password request with the native client flow. Done means the recipient can see the shared file and the collaborators list contains only one destination user.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100