Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enablement for OnlyOffice integration #2132

Closed
micbar opened this issue Jun 7, 2021 · 10 comments
Closed

Enablement for OnlyOffice integration #2132

micbar opened this issue Jun 7, 2021 · 10 comments
Labels
Category:Research Research is needed Interaction:Needs-Concept Interaction:Needs-help Asking some hints to engineering when the issue can't be reproduced OCIS-Fastlane Planned outside of the sprint Priority:p2-high Escalation, on top of current planning, release blocker Topic:API Type:Story User Story

Comments

@micbar
Copy link
Contributor

micbar commented Jun 7, 2021

Feature

Use OnlyOffice with a Full Stack ocis Instance.

Building Blocks

OnlyOffice-oCIS

Challenges

  1. How would the document server authenticate requests whithout a user context?
  2. How does the connector service create a user context for the Storage Server?
@micbar micbar added Interaction:Needs-Concept Interaction:Needs-help Asking some hints to engineering when the issue can't be reproduced Priority:p2-high Escalation, on top of current planning, release blocker Topic:API Category:Research Research is needed labels Jun 7, 2021
@micbar
Copy link
Contributor Author

micbar commented Jun 7, 2021

@butonic @wkloucek @dragotin

We need to help OnlyOffice on the Fastlane IMO.

@wkloucek How does the Collabora / WOPI Server stack solves this issue conceptually?

@micbar micbar added the OCIS-Fastlane Planned outside of the sprint label Jun 7, 2021
@wkloucek
Copy link
Contributor

wkloucek commented Jun 7, 2021

On a file open action the user is redirected to Collabora with an access token as parameter, which will be used by Collabora to authenticate against the CS3 WOPI server. The CS3 WOPI server will then will use an access token embedded in the outer access token to authenticate against REVA. Example, you can just inspect the access_token=ey... part with jwt.io: https://collabora.ocis-wopi.latest.owncloud.works/loleaflet/4aa2794/loleaflet.html?permission=edit&WOPISrc=https%3A%2F%2Fwopiserver.ocis-wopi.latest.owncloud.works%2Fwopi%2Ffiles%2F1284d238-aa92-42ce-bdc4-0b0000009157-MjVlMzMwNDQtZWU3OC00YjA1LTk5ZjUtZWFiZDM0NTVkNmQ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TFwRVozaGFWRnBwVFZSRmFWaFJQVDBpZlN3aWRXbGtJanA3SW1SbFkyOWtaWElpT2lKd2JHRnBiaUlzSW5aaGJIVmxJam9pVFdwQmQwMUVRVDBpZlgxOWZTd2ljMk52Y0dVaU9uc2lkWE5sY2lJNmV5SnlaWE52ZFhKalpTSTZleUprWldOdlpHVnlJam9pYW5OdmJpSXNJblpoYkhWbElqb2laWGxLZDFsWVVtOUphbTlwVEhsS09TSjlMQ0p5YjJ4bElqb3hmWDE5Lm1IeWRQb3NPNm9GZ1p0eklQcnRWT1Nydmp5aHVSYk5oZ2pMVXlpTEl5eW8iLCJmaWxlbmFtZSI6Ii91c2Vycy80YzUxMGFkYS1jODZiLTQ4MTUtODgyMC00MmNkZjgyYzNkNTEvTmV3IGZpbGUub2R0IiwidXNlcm5hbWUiOiJBbGJlcnQgRWluc3RlaW4iLCJ2aWV3bW9kZSI6IlZJRVdfTU9ERV9SRUFEX1dSSVRFIiwiZm9sZGVydXJsIjoiL2hvbWUiLCJleHAiOjE2MjMxNTk2MDcsImVuZHBvaW50IjoiMTI4NGQyMzgtYWE5Mi00MmNlLWJkYzQtMGIwMDAwMDA5MTU3In0.pIbqBbv76I2VV7f8FMdW0EWgYhJU603friSNkFEv1Uc

This could basically also done with just one access token if the OnlyOffice connector is talking to Reva and providing a custom API for OnlyOffice.

This is automatically send by ownCloud Web.
You need to add a middleware to use it:
https://github.com/owncloud/ocis-wopiserver/blob/b4935f59799e637b3324c2e02c06c79db994dfa1/pkg/server/http/server.go#L42-L45

And then you can use it like this:
https://github.com/owncloud/ocis-wopiserver/blob/b4935f59799e637b3324c2e02c06c79db994dfa1/pkg/service/v0/service.go#L118

@pascalwengerter
Copy link
Contributor

@rpocklin saw you working on sth similar in web so adding you to the loop / keeping you posted 😉

@pmaier1
Copy link
Contributor

pmaier1 commented Jun 11, 2021

@Antipkin-A @LinneyS FYI

@settings settings bot removed the p2-high label Jul 1, 2021
@exalate-issue-sync exalate-issue-sync bot changed the title onlyOffice integration Enablement for OnlyOffice integration Aug 10, 2021
@settings settings bot removed the p2-high label Sep 1, 2021
@wkloucek
Copy link
Contributor

wkloucek commented Sep 8, 2021

Questions

  1. How should one configure CS3 client when working from our plugin? Is
    there a possibility to load the pre-configured client?

  2. How can we send an authorized CS3 API request on behalf of the user
    from plugin backend? In the chat you specified that such a request might
    be sent via go context, but afterwards it is unclear for us which key
    has to be used, i.e. the key that other services will check for the
    authorization token presence.

  3. Do you have any simple usage example of CS3 API InitiateFileDownload
    and InitiateFileUpload methods?

  4. Is there any data that must be additionally encrypted when sent to
    the Document Server that might be hosted on another server?

    • https should be always used (with insecure option for development)
    • there is no file encryption

Implementation recommendation

  1. app provider

App provider workflow

  1. only office driver registers itself at the app registry https://github.com/cs3org/reva/blob/f004c26ecbc20e21543d6db27e2d5bfce9022146/pkg/app/provider/demo/demo.go#L35 with mimetypes it can handle and additional information https://github.com/cs3org/cs3apis/blob/63c2cee07f9008758a48691dfa45e4181b800b81/cs3/app/registry/v1beta1/resources.proto#L34-L59
  2. if a user decides to open a file with only office "GetAppURL" will be called in the only office driver: https://github.com/cs3org/reva/blob/f004c26ecbc20e21543d6db27e2d5bfce9022146/pkg/app/provider/demo/demo.go#L42-L48. This will lead ownCloud Web to open the given content in an iframe (as a form post or with a http get, is currently being implemented).

In order for this to work you need a server that:

  • serves some html wich can be embedded into that iframe

The html in the iframe can receive a token and additional information via from parameters (form post) or as headers (http get).

The token can then be used to load the document via the CS3APIs and display it (from the backend which also served the html)

@wkloucek
Copy link
Contributor

In order that OnlyOffice works with the CS3 WOPI server, we need this patch: cs3org/wopiserver#47

Then following deployment can open and edit files with OnlyOffice: #2478

@settings settings bot removed the p2-high label Sep 29, 2021
@glpatcern
Copy link

In order that OnlyOffice works with the CS3 WOPI server, we need this patch: cs3org/wopiserver#47

Actually with the latest fixes where Reva mints short tokens for WOPI, that patch ought to be obsolete. And if not, to be rediscussed but I still have the conceptual concern I had put there: I don't think it's good for WOPI to inspect the Reva token, so far WOPI considers it totally as an opaque info representing the user's credentials.

@wkloucek
Copy link
Contributor

OnlyOffice with WOPI in oCIS can now be tried out here: https://owncloud.dev/ocis/deployment/continuous_deployment/#ocis-with-wopi-server

@wkloucek
Copy link
Contributor

@micbar @pmaier1 When is this ticked done? I pinged OnlyOffice in the chat and they will have a look at the current WOPI setup. So this should be fine for now?

@kulmann
Copy link
Contributor

kulmann commented Jan 18, 2022

Yes, I think we can close here. Anything else (bugs or future features) deserves new, dedicated issues.

@kulmann kulmann closed this as completed Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:Research Research is needed Interaction:Needs-Concept Interaction:Needs-help Asking some hints to engineering when the issue can't be reproduced OCIS-Fastlane Planned outside of the sprint Priority:p2-high Escalation, on top of current planning, release blocker Topic:API Type:Story User Story
Projects
None yet
Development

No branches or pull requests

6 participants