Repository navigation
Android: request only the scopes the Desktop OAuth client is granted - #417
Merged
Merged
Conversation
added 2 commits
November 4, 2026 21:20
Dvorinka#414 added a second companion object for the 2FA result codes, but the class already had one holding the OAuth constants. Kotlin allows only one per class, so compileDebugKotlin failed with "Only one companion object is allowed per class" and unresolved OAUTH_* references. Move the two constants into the existing companion object. Verified with ./gradlew :app:assembleDebug on JDK 21.
"Sign in with browser" failed with "Invalid scope requested": the app uses the built-in Desktop client, whose seeded scopes do not include UserSecurityInfo.Write (only the iOS client has it), and the server requires requested scopes to be a subset of the client's. The app calls no endpoint guarded by that scope, so drop it.
Mira PR Walkthrough❌ Review failed — click for detailsThe code review failed to complete due to an unexpected error. Stage: Code review |
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.
"Sign in with browser" fails on every server with
Invalid input parameters (Invalid scope requested).The app authenticates as the built-in Desktop OAuth client (
393a1839-f52e-498e-9972-e77cc2241eee), which the server seeds ininventory/migration.gowith these scopes:LoginViewModel.OAUTH_SCOPESadditionally requestsUserSecurityInfo.Write, which only the iOS client is granted.service/oauth/oauth.gorequires the requested scopes to be a subset of the client's registered scopes, so the authorize call is rejected before the user ever sees the consent page.Dropping that scope restores the browser login. The app does not call any endpoint guarded by
UserSecurityInfo.Write(the/user/setting/2fa,authn, email and phone routes), so nothing is lost.Reproduced against Cloudreve 4.23.7 on an Android 16 emulator: before the change the browser flow stops with the error above; with the change the whole flow completes — authorize, the desktop mount-folder callback, the
cloudreve://mountdeep link, token exchange, and a logged-in session.Stacked on #416: this branch includes that one-line compile fix so it builds against the current (broken)
master. Once #416 merges, this rebases to a single commit.