Skip to content

[flutter_appauth] Improve SFSafariViewController user cancellation handling - #670

Open
bshvets-ama wants to merge 3 commits into
MaikuB:masterfrom
bshvets-ama:master
Open

[flutter_appauth] Improve SFSafariViewController user cancellation handling#670
bshvets-ama wants to merge 3 commits into
MaikuB:masterfrom
bshvets-ama:master

Conversation

@bshvets-ama

@bshvets-ama bshvets-ama commented Jul 27, 2026

Copy link
Copy Markdown

Summary

Handle interactive dismissal of SFSafariViewController to ensure the external user agent flow is completed correctly when the controller is dismissed with a swipe gesture.

Changes

  • Added UIAdaptivePresentationControllerDelegate conformance to OIDExternalUserAgentIOSSafariViewController.
  • Registered the UIPresentationController delegate for SFSafariViewController.
  • Implemented presentationControllerDidDismiss:.
  • Changed the dismissButtonStyle to match the ASWebAuthenticationSession behavior.
  • Reused the existing cancellation logic so both tapping Cancel and interactive dismissal follow the same code path.
  • Changed the cancellation error reported by SFSafariViewController dismissal to OIDErrorCodeUserCanceledAuthorizationFlow to align with user-initiated cancellation semantics.

Fixes #649

@bshvets-ama bshvets-ama changed the title [flutter_appauth] Handle interactive dismiss for SFSafariViewController [flutter_appauth] Improve SFSafariViewController user cancellation handling Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS] authorizeAndExchangeCode never completes when sfSafariViewController is dismissed by swipe

1 participant