Skip to content

feat: Guest auth - #3338

Merged
JammingBen merged 7 commits into
mainfrom
guest-auth
Oct 14, 2026
Merged

JammingBen merged 7 commits into
mainfrom
guest-auth

Conversation

@kulmann

@kulmann kulmann commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Description

Lets guests authenticate via the invitation link they receive by email.

  • New resolve page at /g/:token trades the link token for a guest session via POST guestLinks/verify/token. The server sets the session as an httpOnly cookie (signed JWT, 24h), web only keeps the permissionId in localStorage.
  • Guest context in the auth store, restored on reload. Graph, WebDAV, OCS, SSE, web workers and uploads send credentials while it is active.
  • Error states for invalid, expired, already used and revoked links. An already used link reuses a still valid session in the same browser.
  • An expired session (session_expired 401) clears the guest context. A logged-in user always takes precedence over a guest session.
  • Graph client regenerated against the current libre-graph-api, including wrappers for renew and verify/pin (not used yet).

Scope: after a successful resolve, the guest lands on a placeholder page (/guest/:shareName) confirming the active session.

Not tackled yet (follow-ups):

  • Guest UI for browsing the invited resource ([Guests] Use the full OpenCloud Web UI as an authenticated guest #2825), which replaces the placeholder.
  • Session expiry handling from [Guests] Authenticate a guest via the emailed link on a resolve page #2823: warning toast before expiry, renew request, "check your inbox" page and PIN form. The toast needs the backend to expose the session expiry.
  • The create-space member picker (SpaceMemberSelect / useCreateSpace) now offers email guests, but guest invites for spaces are not supported by the backend yet. Space invites emit SpaceShared, which auth-guest doesn't consume, so no guest token or email is created, and sharedWithMe doesn't list space memberships. This is fine for now, since guest space invites are planned for the future and will be handled then.

Issue

How Has This Been Tested?

Apart from the automated tests, if you want to test this manually:

  1. run docker run --rm --network container:web_oc natsio/nats-box nats -s nats://127.0.0.1:9233 sub main-queue --raw | jq --unbuffered -r 'select(.Metadata.eventtype | test("GuestTokenCreated")) | .Payload | @base64d | fromjson | .Token'
  2. create a guest invite
  3. copy the token from the output of (1)
  4. use the token in the URL https://host.docker.internal:9200/g/

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@kulmann
kulmann added this pull request to stack #3339 September 9, 2026 12:29
Base automatically changed from guest-invite to main September 29, 2026 07:30
@kulmann
kulmann force-pushed the guest-auth branch 6 times, most recently from 380c74b to b7f3402 Compare October 8, 2026 13:48

const description = computed(() => {
if (unref(space)) {
return $gettext('Your guest access to "%{name}" is active.', { name: unref(space).name })

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only a placeholder for the success case. in later iterations we will redirect the success case to a view where you can list files/folders and only keep this page for error states.

@JammingBen JammingBen changed the title Guest auth feat: Guest auth Oct 14, 2026
@JammingBen
JammingBen merged commit a98f45b into main Oct 14, 2026
27 checks passed
@JammingBen
JammingBen deleted the guest-auth branch October 14, 2026 12:45
@openclouders openclouders mentioned this pull request Oct 14, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants