Skip to content

[Bug]: Adding a public share to your Nextcloud does not work if no user is specified and the user is not logged in #44825

Open
@danxuliu

Description

⚠️ This issue respects the following points: ⚠️

Bug description

In Nextcloud 28 and later right now this does not work because the federated file sharing plugin for the Files app is not compatible with the changes introduced in Nextcloud 28. But, even if it did, it is likely that the problem described below still happens :-)

In the public share page, if outgoing federated shares are enabled, the top right menu includes an Add to your Nextcloud item. When clicked an input field is shown, where it is expected that user@yourNextcloud.org is set. That sends a request to the sharer server to create a federated share with the remote server and user specified in the input.

However, in the dawn of time, only the remote server was expected to be set in the field. This legacy behaviour is still supported. In that case the page redirects to the Files app in the remote server with some special query fields, so once the Files app is loaded the sharer server is asked to create a federated share with the remote server and the now known user.

The problem is that, if the user was not already logged in when sending the Add to your Nextcloud form, before the Files app is opened the user will get redirected to index.php/login?redirect_url=/index.php/apps/files#remote={HOST}&token={SHARE_TOKEN}&owner..., and after logging in the part after the # will be lost and the user will be simply redirected to /index.php/apps/files without causing the addition of the public share. This is reproducible at least on Nextcloud 22.0.0; I did not check further back to find when the regression was introduced, though.

Steps to reproduce

  • Setup Nextcloud server A
  • Setup Nextcloud server B
  • In server A, create a public share
  • Ensure that no user is logged in server B in the current browser window
  • Open the link to the public share
  • In the top right menu, click on "Add to your Nextcloud"
  • Enter the address of server B (only the address, without user@)
  • In server B, log in as a user
  • Open the Files app

There is no dialog to add the remote share to your account

Expected behavior

There is a dialog to add the remote share to your account

Installation method

None

Nextcloud Server version

master

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

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

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions