Hi,
we have problems here with the app/desktop login.
Symptoms
- First login using the app (technically: login flow v2) opens the browser
- log in says: âyou are logged inâ, then you try to grant access
- you get redirected back to the login page on the browser
- if you try to login a second time, you sometimes get âforbidden state tokenâ
Workarounds
- In our cases, it always (?) seems to work, whenever you are logged in in the browser before you start the process in the app/desktop.
- sometimes it works, when you leave the login window open and start the process anew, it seems the session in the browser remembers a previous login-grant. It is unclear, if a race condition is a problem.
- a hint for a solution: if you tried to log in with a first user the first time, then restart the process and login with a second user and get access, it is the access of the first user (!)
Setup/Versions this happens
- NC 29.x, NC 30.x, NC 31.x (latest at the moment: 29.0.16, 30.0.10, 31.0.4) all dockerized using the community docker with no modifications
- nginx reverse proxy using the recommended settings from the docs
- using / not using the high performance backend (notify_push)
- several client versions, e.g. â3.16.3daily (Ubuntu)â, âcom.nextcloud.client v3.31.1â, âiOS âŠâ
- users log in using LDAP/AD,
- some have 2FA enabled, some not, happens with both
Links/reports that we recognized:
- [Bug]: Canât login from iOS client app #50619
- State token missing (Login Flow V2) #3403
- Current log in issues on iOS #3436
- Access Forbidden State token Missing iOS app - #28 by Scottycooks
checks that we tried to rule out
- âoverwriteprotocolâ set to âhttpsâ - was always the case
- turned the high performance backend off/on
- tried to set all possible IPs into the âtrusted proxiesâ array, since the containers have different IPs once in a while
- we donât use some old fcgi apache module but the php-fpm docker container
- we donât use http/3
educated guesses
- we acknowledge @inet_cologne s guess: fix: Redirect user to login if session is terminated by susnux · Pull Request #49208 · nextcloud/server · GitHub that a bug might be introduced and backported to NC31- NC29 and thatâs why we canât really pin-point where in history this got to us.
Anyone more suggestions?
Thanks!