[flutter_appauth][iOS] Support HTTPS redirect URIs on iOS 17.4+#662
Open
KhaleelSH wants to merge 2 commits into
Open
[flutter_appauth][iOS] Support HTTPS redirect URIs on iOS 17.4+#662KhaleelSH wants to merge 2 commits into
KhaleelSH wants to merge 2 commits into
Conversation
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.
Summary
This adds support for HTTPS redirect URIs on iOS 17.4 and newer by using
ASWebAuthenticationSessionCallbackwithcallbackWithHTTPSHost:path:when the request redirect URL uses thehttpsscheme.The change applies to both default and ephemeral
ASWebAuthenticationSessionflows. Custom-scheme redirects continue to use the existingcallbackURLScheme:path, andSFSafariViewControllerbehavior is unchanged.What Changed
ASWebAuthenticationSessionflows through the custom iOS external user agent.postLogoutRedirectUrl, so the HTTPS callback API is only used when a valid HTTPS host is available.webcredentials:<host>Associated Domains setup and matchingapple-app-site-associationconfiguration.Notes
Apple's HTTPS callback API uses associated web credentials domains. It is not the normal
applinksuniversal-link flow, so the README calls out the requiredwebcredentialsentitlement.HTTPS redirect URIs only work on iOS 17.4 and newer because the required
ASWebAuthenticationSessioncallback initializer is unavailable on earlier iOS versions. Apps that still support older iOS versions should keep a custom-scheme redirect fallback registered with their identity provider.Testing
melos run analyzemelos run test:unit --no-selectmelos run build:example_iosxcrun clang-format --dry-run --Werror flutter_appauth/ios/flutter_appauth/Sources/flutter_appauth/OIDExternalUserAgentIOSNoSSO.m flutter_appauth/ios/flutter_appauth/Sources/flutter_appauth/OIDExternalUserAgentIOSNoSSO.h flutter_appauth/ios/flutter_appauth/Sources/flutter_appauth/AppAuthIOSAuthorization.mgit diff --cached --check