Repository navigation
oauth: fix WebFinger subject check for internationalized domain names - #1281
Merged
Merged
Conversation
TheOneRing
requested changes
Nov 24, 2026
TheOneRing
left a comment
Contributor
There was a problem hiding this comment.
Please adopt your change according to https://github.com/opencloud-eu/.github/blob/main/profile/AI_GUIDELINE.md
QUrl returns IDN hosts in Unicode, while the server returns the WebFinger subject percent-encoded, so the string comparison failed and login to IDN servers was impossible. Send the resource as punycode and compare with Utility::urlEqual() instead. Assisted-by: Claude Code:claude-opus-5-5
jnodev
force-pushed
the
work/oauth-idn-webfinger
branch
from
November 24, 2026 22:25
7578abf to
1333682
Compare
Author
|
Thanks for the pointer. I've updated the commit (replaced Co-Authored-By with an Assisted-by tag and shortened the message) and rewrote the PR description following the AI guideline. |
TheOneRing
approved these changes
Nov 25, 2026
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1280
Logging in to a server on an internationalized domain name (e.g.
cloud.bücher.de) fails with "Error while trying to log in to OAuth2-enabled server".Cause: the client sends the WebFinger
resourcein Unicode form (QUrl::toString()) and string-compares the returnedsubject. The server returns it percent-encoded (https://cloud.b%C3%BCcher.de/), so the check fails.Fix: send the resource as punycode (
QUrl::EncodeUnicode) and compare it withUtility::urlEqual(). Token refresh uses the same code path and is fixed too.Details
urlEqual()also ignores a trailing slash and normalizes path segments, so the subject check is slightly more lenient than before.TestOAuth::testInternationalizedDomainNamefails without the fix.OAuthTestCasegets a virtualserverUrl()for it; existing tests are unchanged.AI usage
I used Claude Code (Claude Opus 5.5) to analyse the root cause and to draft the fix and the test. I reviewed the change, built it and tested it myself against a real IDN server.