nextcloud / nextcloud/user_oidc

Nextcloud site constantly reloading due to token refresh

Open
#1,449 14 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
PHP
Stars
181
Forks
60
Avg merge
7h 34m
Merged PRs (30d)
26

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Ever since #1391, Nextcloud often reloads the page, losing any progress in whatever was being worked on.

Steps to reproduce
  1. Log in using an OIDC IDP with the store_login_token option enabled (used Authentik).
  2. Wait the isExpiring() threshold duration.
  3. Lose any in-progress work on your current page (any app which does not constantly silently save progress), as Nextcloud reloads and goes through the token exchange flow.
Expected behaviour

In-progress work should not be lost and the focused page should not arbitrarily redirect away if possible...

Behaviour this invasive should at least come with a separate toggle in the UI and a warning message.

Actual behaviour

After the token refresh timeout, even if the user is working on something, a browser redirection flow begins to

  1. /login?redirect_url=...
  2. /apps/user_oidc/login/1?redirectUrl=...
  3. https://idp..../application/o/authorize/?...
  4. /apps/user_oidc/code?...&state=...

before finally landing back on the current page url, with any previous unsaved work in progress on that page lost in the process.

Server configuration

Web server: docker nextcloud:apache

Database: PostgreSQL

PHP version: 8.4

Nextcloud version: 33.0.4

Browser

Browser name: Firefox

Browser version: 151.0.2

Operating system: Fedora 44

IDP: Authentik

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the token refresh flow introduced by #1391, including the isExpiring() threshold and the /login, /apps/user_oidc/login/1, and /apps/user_oidc/code entry points. Reproduce with store_login_token enabled and an OIDC provider, then verify that an active page no longer enters the redirect flow or loses unsaved work after the refresh timeout.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, postgresql
Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.