Open bmarchionni opened 5 years ago
I can confirm this behavior. On each error, including canceling authentication (navigating back), the uncatchable exception is thrown and cause the application to crash.
This behavior is different from Android and iOS, where exception is not thrown and you can handle errors on your own.
pageType
to your WebAuthenticatorPage: System.Type pageType = typeof(WebAuthenticatorPage);
(line 23).AuthenticationConfiguration.Init()
from UWP project and register your OAuthLoginPresenter with following code:Xamarin.Auth.Presenters.OAuthLoginPresenter.PlatformLogin = (authenticator) =>
{
var presenter = new OAuthLoginPresenter(); // Your OAuthLoginPresenter
presenter.Login(authenticator);
};
@luka454
I am getting the following exception on successful Authentication credentials entered into web page.
Xamarin.Auth.AuthException: Auth Error at Xamarin.Auth.WebAuthenticatorPage.auth_Error(Object sender, AuthenticatorErrorEventArgs e) at Xamarin.Auth.Authenticator.<>cDisplayClass30_0.
b0() at Plugin.Threading.UIThreadRunInvoker.<>cDisplayClass0_0. 0()b
Tried the above Workaround, but no debug point hit on added classes.
NOTE :
AuthenticationConfiguration.Init()
in my code. OnLaunched
method.Xamarin.Auth.Presenters.OAuthLoginPresenter.PlatformLogin = (authenticator) =>
{
var presenter = new UWPOAuthLoginPresenter(); // Your OAuthLoginPresenter
presenter.Login(authenticator);
};
Thanks.
We currently have the same issue :( is there any workaround ?
Xamarin.Auth Issue
IF BUG, INCLUDE THIS PART:
Version
Steps to reproduce
Platform:
Expected behaviour
The Authenticator.Error should be raised but no exception should be throw.
Actual behaviour
An exception is thrown that can't be caught
I believe we just need to change Xamarin.Auth.UniversalWindowsPlatform/WebAuthenticatorPage.Events.xaml.cs line 101 from
private void auth_Error(object sender, AuthenticatorErrorEventArgs e) { throw new Xamarin.Auth.AuthException("Auth Error"); }
to
private void auth_Error(object sender, AuthenticatorErrorEventArgs e) { System.Diagnostics.Debug.WriteLine("Auth Error" + e.Message); }