[flutter_appauth][iOS] Support HTTPS redirect URIs on iOS 17.4+ - #662
[flutter_appauth][iOS] Support HTTPS redirect URIs on iOS 17.4+#662KhaleelSH wants to merge 2 commits into
Conversation
|
That would be the ideal solution. I'm just a bit afraid that that PR is still open since a while, and would take more time to get merged. But anyways, thank you for letting me know you're holding off on this, I believe I'll use my fork until the mentioned PR is merged. Have a nice day. |
|
@MaikuB I would like to advocate for this PR to be reviewed and merged. I stumbled on this PR, because I also need it. It's not clear that the maintainers of AppAuth-iOS have even acknowledged openid/AppAuth-iOS#938 and leading authentication providers (example) have been saying for a while that custom URL schemes are not secure. |
|
@travishaagen understood however I'm busy ATM as I'm in the process. If you haven't done so already or weren't aware, note that you can create a fork based on this PR and use it directly in your app in the meantime |
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