Repository navigation
Conversation
When an existing account signs in again, the app opens the login URL of login flow v2 without the user of the account. In the same case, the desktop client adds the user to the login URL, as the "user" parameter. A server can use this parameter in these ways: - Nextcloud pre-fills its login form with the user. - A server can refuse the grant when another account is signed in in the browser. - A server can hand out the login name that the account was created with. The last point matters because of commit 1c3451b. That commit made the app compare the user ID of the new credentials with the user ID of the account. Some servers gave an account another login name in the past. Without the parameter, such a server cannot know which login name the account holds. The server then hands out the current name, and the app refuses the new credentials after the person granted access. The app now appends the user name of the account to the login URL that the server returns, when it signs an existing account in again. The login URL of a new account, and the default login URL, stay unchanged. Assisted-by: ClaudeCode:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Problem
When an existing account signs in again, the app opens the login URL of login flow v2 without the user of the account. In the same case, the desktop client adds the user to the login URL, as the
userparameter.A server can use this parameter in these ways:
The last point matters because of commit 1c3451b. That commit made the app compare the user ID of the new credentials with the user ID of the account. Some servers gave an account another login name in the past. Without the parameter, such a server cannot know which login name the account holds. The server then hands out the current name, and the app refuses the new credentials after the person granted access.
Change
AuthenticatorUrlUtils.appendLoginUser()appends the user, URL-encoded, as theuserparameter.AuthenticatorActivitysigns an existing account in again, it appends the user name of the account to the login URL that the server returns. The login URL of a new account, and the default login URL, stay unchanged.How to verify
user=and the user name of the account. On Nextcloud, the login form shows the user name already filled in.The unit tests in
AuthenticatorUrlUtilsTest.AppendLoginUsercover a login URL with a query, a login URL without a query, and the encoding of the user.🖼️ Screenshots
No screenshots. The change was not run on a device.
🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)
🤖 Generated with Claude Code