From 8d5e79cd175ea62e4709fae0ebef3f809f04c7f9 Mon Sep 17 00:00:00 2001 From: Giuseppe Lo Presti Date: Mon, 11 Oct 2021 18:31:49 +0200 Subject: [PATCH] Provide a consistent userid over time to WOPI --- changelog/unreleased/wopi-consistent-userid.md | 6 ++++++ pkg/app/provider/wopi/wopi.go | 1 + 2 files changed, 7 insertions(+) create mode 100644 changelog/unreleased/wopi-consistent-userid.md diff --git a/changelog/unreleased/wopi-consistent-userid.md b/changelog/unreleased/wopi-consistent-userid.md new file mode 100644 index 0000000000..c357b72343 --- /dev/null +++ b/changelog/unreleased/wopi-consistent-userid.md @@ -0,0 +1,6 @@ +Enhancement: pass an extra query parameter to WOPI /openinapp with a +unique and consistent over time user identifier. The Reva token used so far +is not consistent (it's per session) and also too long. + +https://github.com/cs3org/reva/pull/2155 +https://github.com/cs3org/wopiserver/pull/48 diff --git a/pkg/app/provider/wopi/wopi.go b/pkg/app/provider/wopi/wopi.go index 9e91044e71..2ac83647e2 100644 --- a/pkg/app/provider/wopi/wopi.go +++ b/pkg/app/provider/wopi/wopi.go @@ -139,6 +139,7 @@ func (p *wopiProvider) GetAppURL(ctx context.Context, resource *provider.Resourc u, ok := ctxpkg.ContextGetUser(ctx) if ok { // else defaults to "Guest xyz" q.Add("username", u.Username) + q.Add("userid", u.Id.OpaqueId+"@"+u.Id.Idp) } q.Add("appname", p.conf.AppName)