xamarin / Xamarin.Auth

Xamarin.Auth
Apache License 2.0
541 stars 351 forks source link

Using embedded webview cancel button on iOS UI does not fire Error event on Xamarin.iOS #342

Open terrencejames opened 5 years ago

terrencejames commented 5 years ago

Xamarin.Auth Issue

Version

Steps to reproduce

  1. Run the above code so that the UI presents
  2. Click the cancel button on the top left of the embedded webview (it's a little light but it's there) alt-text
  3. Notice that error event is not fired, only completed event, so OnCancelled() is never called
  4. Try to repeat step 1
  5. Will not present the UI anymore probably because OnCancelled() was never called in the Completed Event

Platform: Tested on iPhone X

Expected behaviour

Error event is triggered so OnCancelled() can be called

Actual behaviour

Error event not triggered

Notes: Clicking the "Cancel" button below "Sign In" works as expected and the error event is raised

VS bug #733069

terrencejames commented 5 years ago

A temporary fix is disabling the AllowCancel flag, so that the user can just use the cancel button in the OAuth UI, but I expect there will not always be a cancel button

moljac commented 5 years ago

triaging it as "Low Priority"

In order to speed up the bugfixing, add link to the repo with minimal sample (with removed sensitve data)

terrencejames commented 5 years ago

Issue still happens, also notice that it happens on Android when clicking the hardware back button.

terrencejames commented 5 years ago

I've fixed the issue in the source code by calling authenticator.OnError(String.Empty); inside Cancel() in WebAuthenticatorController.cs