Skip to content

[Guests] Authenticate a guest via the emailed link on a resolve page #2823

Closed

Description

@kulmann

User Story

  • As a guest who has received an invitation link by email, I want to click the link and be authenticated on a resolve page (similar to how a public link resolves), so that I can gain access to the resource I was invited to without needing a full OpenCloud account, for a limited, renewable session.

Context

Reference: opencloud-eu/opencloud#2517 (comment) for the detailled authentication mechanics.

User value

Guest authentication

Technical notes

There are two tokens involved:

  1. The invitation link contains a token which is not suitable to authenticate requests, but only to trade it for a JWT session token. It might have a long lifetime than the guest session (not guaranteed though).
  2. The guest session granted by resolving that link is short-lived (24 hours). It holds a JWT which can authenticate requests.

Expiry of the session does not invalidate the link; the recipient renews by authenticating again.

Acceptance Criteria

  • Clicking a guest invitation link opens a dedicated resolve page in the Web UI, similar to the existing public-link resolve page.
  • The resolve page authenticates the link (token from url), as described in the referenced issue comment, trading it for a short lived (24h) JWT which is then used as bearer token for authenticating all requests towards the backend.
  • The JWT is stored in the sessionStorage
  • On successfully resolving the email link into a guest session with JWT session token, the guest is redirected to the resource they were invited to (redirect target derived from the JWT, not from a user-supplied parameter).
  • While the guest session is valid, the guest can navigate, refresh, and work in the shared resources
  • Shortly before the JWT expires a toast is shown that the session will expire soon (15 minutes before expiry). This is important to be able to persist unsaved changes.
  • After the JWT expired:
    • web retrieves a 401 error with token_expired or session_expired on any request, which also includes a share id.
    • web sends a POST with the share id from the 401 to a renew endpoint, which will generate a new magic token and sends an email to the user.
    • web displays a page, similar to our "logged out" page for regular users, informing the user that the guest session expired and that they should check their email inbox
  • If the initial link/token is invalid, revoked, or the invitation has expired, the resolve page shows an error state and does not grant a session.
  • The resolve page does not leak resource identifiers or invitation metadata before authentication succeeds.

Activity

  1. moved this from Qualification to Backlog in OpenCloud Team Boardon Jul 7, 2026
  2. moved this from Backlog to Blocked in OpenCloud Team Boardon Aug 20, 2026
  3. self-assigned this
    on Sep 9, 2026
  4. JammingBen commented on Oct 14, 2026

    @JammingBen
    Member

    #3338 tackles most of this. There some parts missing though:

    The JWT is stored in the sessionStorage - this is not possible, Web never has access to the JWT. It sits securely in the cookie that gets send to the server automatically.

    Shortly before the JWT expires a toast is shown that the session will expire soon (15 minutes before expiry). This is important to be able to persist unsaved changes. - this is not yet possible, web never knows the expiration date of the JWT (because it can't access the JWT, see above). see #3797

    On successfully resolving the email link into a guest session with JWT session token, the guest is redirected to the resource they were invited to (redirect target derived from the JWT, not from a user-supplied parameter). and While the guest session is valid, the guest can navigate, refresh, and work in the shared resources - gonna be tackled via #2825.

    After the JWT expired - gonna be handled in a separate story, there is more work to do (also on the server side I believe): #3796

  5. moved this from Blocked to In Progress in OpenCloud Team Boardon Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions