Skip to content

Optimize resources during token renewal #1551

Closed

Description

@individual-it

Currently, token renewal bootstraps the whole web client in an iFrame, which is quite costly and takes time with a bad connection. This can result in the page not behaving correctly, especially during long running operations (e.g. uploads) because token renewal takes too long.

We see two possible solutions to this, both require lots of research and changes:

  1. Web ships a small standalone Vue application that gets bootstrapped in the iFrame. The challenge here is that it needs the AuthService, the UserManager, router etc. We need to find all involved parts and elaborate how to achieve this. Maybe it's possible to move them to this standalone app and use them in the runtime while removing all the dependencies from the standalone app to Web, so it can be run separately.
  2. Make use of the Backends for Frontends (BFF) pattern, moving authentication entirely to the BFF and only having a session cookie in web.
Original issue

Initial Checklist

  • I understand this is a bug report and questions should be posted in the Community Discussions
  • I searched issues and couldn’t find anything (or linked relevant results below)

Bug Description

When an upload takes too long the user session expires and the user is asked to login again
Image

Image

Reproduction Steps

start a long running upload, wait

Expected Outcome

session should not expire

Actual Outcome

user is requested to login again

Activity

  1. JammingBen commented on Nov 6, 2025

    @JammingBen
    Member

    We had a similar report in the past, but I can't reproduce it. Could you please post details on your exact setup? Also, is it happening when uploading a lot of small files, or a very big file that gets chunked?

  2. individual-it commented on Nov 6, 2025

    @individual-it
    ContributorAuthor

    It's when uploading multiple 2-3MB files on a slow connection. To simulate it easier I've throttled the connection in the browser.
    here my docker files. I hope I've masked all confidential data. I can provide you a user on the system if that helps.
    oc-setup.zip

  3. JammingBen commented on Nov 6, 2025

    @JammingBen
    Member

    Thanks! Let me first have a look at the setup you provided, and I'll message you in chat if I still need a user :)

  4. JammingBen commented on Nov 7, 2025

    @JammingBen
    Member

    Tried again today, locally as well as on demo.opencloud.eu, but it works every time for me:

    Image

    The first bunch of "test" files were uploaded, during the upload the token renewal took place, then the other files were uploaded using a new bearer token.

    I'll hit you up in chat for a user.

  5. moved this from Qualification to Prio 2 in OpenCloud Team Boardon Nov 11, 2025
  6. kulmann commented on Nov 19, 2025

    @kulmann
    Member

    @individual-it nobody from the team is able to reproduce the described behaviour so far. Can you try to reproduce it on demo.opencloud.eu or with a fresh opencloud-compose deployment? Any idea what's different in your setup than in the opencloud-compose standard setup?

  7. individual-it commented on Nov 19, 2025

    @individual-it
    ContributorAuthor

    @kulmann I just reproduced it on demo.opencloud.eu I got logged out

    Image Image
  8. JammingBen commented on Nov 19, 2025

    @JammingBen
    Member

    @kulmann I just reproduced it on demo.opencloud.eu I got logged out

    But this now looks unrelated to an upload? And the behavior is different, because in your initial issue, you had this popup asking you if you really want to leave the page.

    Did it just happen after a while this time? Looks like you did a PROPFIND on a space which failed because the renewal failed in the first place.

  9. individual-it commented on Nov 19, 2025

    @individual-it
    ContributorAuthor

    Not sure if this is the same issue or not, but on demo.opencloud.eu we saw:

    1. two requests to renew tokens are send to keycloak
    2. a PROPFIND is send before any upload finished and that receives a 401
    3. the upload hangs

    differences so far between demo and my instance are:

    • OpenCloud 3.70 vs 4.0.0-rc1
    • I don't use any keycloak
  10. individual-it commented on Nov 19, 2025

    @individual-it
    ContributorAuthor

    reproduced the same behavior as on my instance using https://github.com/opencloud-eu/opencloud-compose
    just throttle the upload e.g. to "Regular 3G" in Firefox and upload some big files

  11. JammingBen commented on Nov 19, 2025

    @JammingBen
    Member

    After talking with the team we decided this is a feature request. It basically comes down to how Web handles token renewal when the connection is bad. Currently, token renewal bootstraps the whole web client in an iFrame, which is quite costly and takes time with a bad connection.

    Ideally, Web ships a small standalone Vue application that gets bootstrapped in the iFrame. The challenge here is that it needs the AuthService, the UserManager, router etc. We need to find all involved parts and elaborate how to achieve this. Maybe it's possible to move them to this standalone app and use them in the runtime while removing all the dependencies from the standalone app to Web, so it can be run separately.

    This requires a lot of research and refactoring.

  12. moved this from Prio 2 to No status in OpenCloud Team Boardon Nov 19, 2025
  13. changed the title [-]session expires during long running uploads[/-] [+]Optimize resources during token renewal[/+] on Nov 19, 2025
  14. kulmann commented on Nov 21, 2025

    @kulmann
    Member

    An alternative approach would be to introduce a backend for web, following the BFF pattern, which moves token management away from the client.

    We have updated the original issue description to reflect the new feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions