Repository navigation
feat(ocm): launch webapps via served launcher - #283
Conversation
67a8250 to
d70f475
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
d70f475 to
f162143
Compare
| ['access-token', accessToken], | ||
| ['access_token', accessToken] |
There was a problem hiding this comment.
It's the same token under the two names Reva reads from a form body:
-
access-token is read by Reva bearer token strategy which checks whether the value is already a Reva token
That form field name comes from existing upstream code cs3org/reva#3315 -
access_tokenis read by the bearer credential strategy which passes an IdP token to the gateway to authenticate, thats the RFC 6750 form field name, and feat(ocm): serve CSP-scoped webapp launcher page cs3org/reva#5906 adds the form-body read there
Webs authStore.accessToken is the OIDC access token so with a normal IdP setup access_token is the field that actually authenticates
access-token covers deployments where the bearer token is already a Reva token
Both go only in the POST body to CERNBoxs own /sciencemesh/webapp-launch never in a URL so the second copy exposes nothing extra
There was a problem hiding this comment.
I can drop access-token here access_token alone is enough for the OIDC token with no Reva change
There was a problem hiding this comment.
Right, we should drop access-token here, the only token the remote user needs is the access_token minted by the exhange-token OCM flow
Signed-off-by: Mahdi Baghbani <[email protected]>
f162143 to
8196f8e
Compare
Signed-off-by: Mahdi Baghbani <[email protected]>
This PR is part of the cs3org/OCM-STA#20 and cs3org/OCM-STA#48
Summary
form-action 'self', which blocks the old form POST to the app's origin (for examplehttps://compute.teosc.se/services/ocm/open). The new form posts to/sciencemesh/webapp-launchon CERNBox's own origin, and Reva answers with a page whose own CSP allows exactly that one app, which then posts to it.about:blankwindow synchronously, so the popup blocker allows it, and submits a hidden form into that window with no await in between. The fields arefile(the resource id),expired_session_redirect_uri(https://plus the current host), and the user's token twice, asaccess-tokenandaccess_token, so both Reva's bearer token strategy and its bearer credential strategy find it. The token travels only in the POST body, never in a URL./sciencemesh/open-in-appXHR, theapp_urlcheck, and the client-side form to the app are gone. Popup-blocked and missing-resource cases keep their messages, and a throwingsubmitcloses the window and shows "Couldn't open remotely".bearercredential strategy, which is in the defaultcredential_chain.bearerintoken_strategy_chainis only needed when the token is already a Reva token. The proxy must not add its own CSP on/sciencemesh/webapp-launch.flowchart TD A["Open remotely with appName"] --> W["window.open about:blank, named ocm-remote-timestamp"] W -->|"null, popup blocked"| PW["popup warning, no request"] W -->|"window"| R{"resource present?"} R -->|"no"| E["close window, Couldn't open remotely"] R -->|"yes"| F["hidden form POST to /sciencemesh/webapp-launch, target = that window"] F -->|"submit throws"| E F -->|"submitted"| L["Reva launcher page, form-action = app origin"] L --> APP["POST access_token to the app URL"]