[flutter_appauth] feat(android): allow restricting which browser handles auth requests - #682
Open
ddfreiling wants to merge 1 commit into
Open
ddfreiling wants to merge 1 commit into
ddfreiling wants to merge 1 commit into
Conversation
Adds an `androidAllowedBrowsers` property to `AuthorizationRequest`, `AuthorizationTokenRequest` and `EndSessionRequest`. Each entry is either one of six presets that map to AppAuth's `VersionedBrowserMatcher` constants, or a custom descriptor naming any browser by package name and signature hashes. The list becomes a `BrowserAllowList` on the `AppAuthConfiguration`. A null or empty list keeps the existing behaviour of allowing any installed browser. The browser matcher is fixed when an `AuthorizationService` is built, so the two pre-built services are replaced with a cache keyed by connection security and browser list. Caching rather than recreating avoids disposing a service while an authorization flow is still in progress. Also wraps the end session intent launch in the same `ActivityNotFoundException` handling that `performAuthorization` already had. Without it, an allow list that matches no installed browser would throw instead of returning a `no_browser_available` error. Refs MaikuB#537 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
What
Adds an
androidAllowedBrowsersproperty toAuthorizationRequest,AuthorizationTokenRequestandEndSessionRequest. Each entry is either one of six presets that map to AppAuth'sVersionedBrowserMatcherconstants, or a custom descriptor naming any browser by package name and signature hashes. The list becomes aBrowserAllowListon theAppAuthConfiguration. A null or empty list keeps the existing behaviour of allowing any installed browser.The browser matcher is fixed when an
AuthorizationServiceis built, so the two pre-built services are replaced with a cache keyed by connection security and browser list. Caching rather than recreating avoids disposing a service while an authorization flow is still in progress.Also wraps the end session intent launch in the same
ActivityNotFoundExceptionhandling thatperformAuthorizationalready had. Without it, an allow list that matches no installed browser would throw instead of returning ano_browser_availableerror.Why
Discussed here as an improvement: #537