Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Boards
    Boards
  • Wiki
    Wiki

Content

Preparation and Research
  1. Stream Nextcloud app "OpenProject Integration"
  2. Wiki
  3. Preparation and Research
  4. File Upload
More
  • Print
  • Table of contents

File Upload

More
  • Print
  • Table of contents
Export
Export
  • Atom
  • Markdown

Version 1/1 — Eric Schubert — 01/07/2022 01:31 PM

At any point, we will want to implement an upload mechanism in our nextcloud integration. Uploads with the Nextcloud API need logic in the frontend, especially for uploading folders or big files that need chunking.

CORS

Nextcloud has a very restrictive CORS policy, forbidding sending requests to the API from browsers, that are not same origin. For the upload, this will be necessary, as mentioned above. The proposed solution is, using the nextcloud extension WebAppPassword to whitelist additional domains to the CORS policy. In a succeeding step we can check the code of the WebAppPassword , to reimplement the configuration of whitelisted domains to eliminate the need of manual configuration.

Authentication

As the authentication is done by the backend (see explanation), the question remains, how the frontend would authenticate an upload request. Here nextcloud's app passwords could solve the issue. Those are generated, permanent passwords, that can be used together with this user's name in a request.

possible workflow

  • do everything, that is needed to authenticate in backend (different worklow)
  • send request to OP backend asking for access to nextcloud's webdav api for file upload
  • backend generates an app password for the linked nextcloud user of the currently logged in OP user
  • backend responds with the nc user credentials (username and app password)
  • frontend makes upload request
  • when frontend is done (success, abort or error) it tells backend to revoke app password und invalidate the access
  • HINT: backend would need to revoke access in any case, even when frontend doesn't come back with success. After a fixed time?
Loading...