step-up-labs / firebase-authentication-dotnet

C# library for Firebase Authentication
MIT License
376 stars 129 forks source link

Feature v4: Anonymous Login Disabled Issue #174

Open alexbeattie42 opened 2 years ago

alexbeattie42 commented 2 years ago

Reproduction

Problem

If the user is null (it will be on load) the following line MainWindow.xaml.cs will try to authentication anonymously:

await FirebaseUI.Instance.Client.SignInAnonymouslyAsync();

This produces a 400 error to firebase since this form of authentication is disabled for the application. As a result the application screen is blank (white) and the following is printed to the debug output:

Exception thrown: 'System.Net.Http.HttpRequestException' in System.Net.Http.dll
Exception thrown: 'Firebase.Auth.FirebaseAuthHttpException' in Firebase.Auth.dll
Exception thrown: 'Firebase.Auth.FirebaseAuthHttpException' in System.Private.CoreLib.dll
Exception thrown: 'Firebase.Auth.FirebaseAuthHttpException' in System.Private.CoreLib.dll

These exceptions are not surfacing the underlying failure (although it appears they should based on code in Auth.FirebaseAuthHttpException). Maybe this is a problem of DLLs not surfacing out exception messages?

Expected Behavior

Patch

Comment or remove the following line in MainWindow.xaml.cs and refactor appropriately:

await FirebaseUI.Instance.Client.SignInAnonymouslyAsync();