Skip to content

[stable35] fix(auth): accept a percent-encoded login name for app password logins - #66433

Open
backportbot[bot] wants to merge 1 commit into
stable35from
backport/64324/stable35
Open

backportbot[bot] wants to merge 1 commit into
stable35from
backport/64324/stable35

Conversation

@backportbot

@backportbot backportbot Bot commented Nov 6, 2026

Copy link
Copy Markdown

Backport of PR #64324

Some clients percent-encode the login name before putting it into the
Authorization header, so an account called "user@example.com" arrives as
"user%40example.com". It then no longer matches the login name the app
password was created with and every request is rejected with "App token
login name does not match", even though the app password itself is correct.

iOS 18.4 started doing this for CalDAV/CardDAV accounts, which is why a
setup that had worked for a year suddenly stopped.

Keep the exact comparison as the first and only check on the happy path,
and decode once before giving up. rawurldecode and not urldecode: a "+" in
a login name is a literal plus sign here, not an encoded space. An
unrelated login name still fails, and a login name that merely belongs to
the same account (the e-mail versus user id case in the TODO) is still
rejected - this only recognises the same name in encoded form.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: Tor Valstrom <51440386+torvalstrom@users.noreply.github.com>
@backportbot
backportbot Bot requested review from a team as code owners November 6, 2026 20:46
@backportbot
backportbot Bot requested review from Altahrim and come-nc and removed request for a team November 6, 2026 20:46
@backportbot backportbot Bot added bug 3. to review Waiting for reviews feature: authentication feedback-requested hotspot: account name handling User / Group names - invalid, consistency, enforcement, etc. labels Nov 6, 2026
@backportbot backportbot Bot added this to the Nextcloud 35.0.3 milestone Nov 6, 2026

This branch has not been deployed

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

Labels

3. to review Waiting for reviews bug feature: authentication feedback-requested hotspot: account name handling User / Group names - invalid, consistency, enforcement, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants