Repository navigation
Fix custom browser user-agent failing the flow when canOpenURL: returns NO - #981
Open
federicobartoli wants to merge 1 commit into
Open
federicobartoli wants to merge 1 commit into
federicobartoli wants to merge 1 commit into
Conversation
w-goog
self-requested a review
October 19, 2026 22:26
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.
Fixes #980.
What
-[OIDExternalUserAgentIOSCustomBrowser presentExternalUserAgentRequest:session:]returned the result ofcanOpenURL:while callingopenURL:options:completionHandler:regardless of it. WhencanOpenURL:answersNOfor a URL that the system can open, the browser opened but the session was failed with "Unable to open Safari.", and the redirect that came back had no pending flow to resume.The method now reports the request as presented and fails the session only if the open really fails, from the completion handler of
openURL:options:completionHandler:. The error code and message are unchanged.Notes
NOreturn value.niltransformed URL still returnsNO.OIDExternalUserAgentSession.his now imported, as the other user-agents already do, because the method callsfailExternalUserAgentFlowWithError:.Testing
httpsinLSApplicationQueriesSchemes, socanOpenURL:returnsNO), with this change applied to AppAuth 2.0.0: Chrome opens, the session stays pending and the sign-in completes. Without the change the flow fails as described in Custom browser user-agent fails the flow with "Unable to open Safari." while the browser opens (it returns the result of canOpenURL:) #980.xcodebuild test -project AppAuth.xcodeproj -scheme AppAuth-iOSon an iPhone 17 Pro simulator (iOS 26.1, Xcode 26.3): 169 tests, 15 skipped, 0 failures. No test covers this class, so this only shows that the change builds onmasterand that nothing else regressed.Contributor agreements
I have signed the Individual Contributor License Agreement.