Repository navigation
fix: Trigger same logic as login failure when Bearer token is not valid - #67315
Conversation
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
|
/backport! to stable35 |
|
Hmm, playwright test are now failing with "429 too many requests" errors 🤔 |
Otherwise they get blocked Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Otherwise it gets enabled again afterwards Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Since nextcloud/server#67315 the server throttles more requests like failed logins. All Playwright tests log in from the same address, so the logins of later tests were refused with 429 Too Many Requests. The server disabled both protections for its own Playwright tests in the same change. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
|
@come-nc this also breaks Collabora. It sends its WOPI access token as richdocuments Cypress runs against master on main and has been failing since this was merged, e.g. https://github.com/nextcloud/richdocuments/actions/runs/46753504564. stable35 fails the same way since the backport, cookie fix included, e.g. https://github.com/nextcloud/richdocuments/actions/runs/46915415739 Other apps whose clients send their own Bearer tokens are probably hit the same way, e.g. Nextcloud Office with Document Server's default JWT header. Could we avoid counting tokens that aren't meant for Nextcloud's own login, and hold the open backports (#67320-#67327) and the next maintenance releases until it's sorted? |
|
It's not only Collabora. These get foreign Bearer tokens too and break on stable33-35:
Once an IP is blocked, its valid Nextcloud tokens and password logins fail too. Could the failed login be registered on the 401 path instead (NotLoggedInException, DAV auth failure), so requests that succeed with an app's own token don't count? Or revert the stable backports until then? |
|
Maybe simpler than the 401 path: only throttle and count Bearer values that look like Nextcloud tokens. App passwords, OAuth2 and client-flow tokens are all 72 alphanumerics ( |
Collabora sends the WOPI access token in the access_token query parameter and also as "Authorization: Bearer <token>", which we never read. Since nextcloud/server#67315 every Bearer token that isn't a Nextcloud token counts as a failed login, so the Collabora server soon gets 429 for its WOPI requests and documents stop loading. Post no_auth_header=1 with the token, so Collabora 25.04.3 and later leave the header out. Older versions ignore the field. The settings iframe only benefits once Collabora passes the flag on there as well. Signed-off-by: Julius Knorr <jus@bitgrid.net> Assisted-by: ClaudeCode:claude-opus-5-5
Summary
Checklist
3. to review, feature component)stable32)AI (if applicable)