firebase / flutterfire

πŸ”₯ A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.68k stars 3.97k forks source link

πŸ› [firebase_auth] web app signIn doesn't throw FirebaseAuthMultiFactorException for MFA enrolled users #12384

Closed JaredEzz closed 7 months ago

JaredEzz commented 8 months ago

Bug report

Describe the bug Flutter web is throwing the following error FirebaseAuthException ([firebase_auth/unknown] An unknown error occurred: FirebaseError: Firebase: Proof of ownership of a second factor is required to complete sign-in. (auth/multi-factor-auth-required).) instead of the expected FirebaseAuthMultiFactorException when a user that is enrolled in MFA signs in.

Steps to reproduce

Steps to reproduce the behavior:

  1. Run a flutter web app and use this code for a login
    final UserCredential userCred =
        await firebaseAuth.signInWithEmailAndPassword(
      email: email,
      password: password,
    );
  2. Sign in with a firebase auth account that has mfa set up (we are using TOTP MFA)
  3. See error FirebaseAuthException ([firebase_auth/unknown] An unknown error occurred: FirebaseError: Firebase: Proof of ownership of a second factor is required to complete sign-in. (auth/multi-factor-auth-required).)

Expected behavior

The signIn should throw FirebaseAuthMultiFactorException to allow to resolve


Additional context

Previous issues have shown that flutterfire is not often up to date with the latest version of Flutter. We are running on the latest version, 3.19.0

Confirmed to work on earlier versions of Flutter, at least as recently as 3.16.5


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` flutter doctor Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 3.19.0, on Microsoft Windows [Version 10.0.22631.3155], locale en-US) [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 33.0.1) [√] Chrome - develop for the web [√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.3) [!] Android Studio (not installed) [√] IntelliJ IDEA Ultimate Edition (version 2023.3) [√] VS Code, 64-bit edition (version 1.86.2) [√] Connected device (3 available) [√] Network resources ! Doctor found issues in 1 category. ```

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand ``` flutter pub deps -- --style=compact Dart SDK 3.3.0 Flutter SDK 3.19.0 ostrich_cyber_risk 1.6.5 dependencies: - archive 3.4.10 [crypto path pointycastle] - async 2.11.0 [collection meta] - carousel_slider 4.2.1 [flutter] - collection 1.18.0 - csc_picker 0.2.7 [flutter] - csv 5.1.1 - currency_text_input_formatter 2.1.11 [flutter intl] - equatable 2.0.5 [collection meta] - fetch_client 1.0.2 [fetch_api http] - firebase_analytics 10.8.6 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_auth 4.17.5 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 2.25.4 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_core_web 2.11.4 [firebase_core_platform_interface flutter flutter_web_plugins js meta web] - firebase_performance 0.9.3+14 [firebase_core firebase_core_platform_interface firebase_performance_platform_interface firebase_performance_web flutter] - firebase_remote_config 4.3.14 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface firebase_remote_config_web flutter] - firebase_remote_config_web 1.4.22 [firebase_core firebase_core_web firebase_remote_config_platform_interface flutter flutter_web_plugins js] - fl_chart 0.66.2 [equatable flutter] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine] - flutter_bloc 8.1.4 [bloc flutter provider] - flutter_expandable_table 2.0.1 [flutter linked_scroll_controller flutter_scroll_shadow provider] - flutter_radar_chart 0.2.1 [flutter] - flutter_treeview 1.0.7+1 [flutter] - flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math] - go_router 13.2.0 [collection flutter flutter_web_plugins logging meta] - google_fonts 6.1.0 [flutter http path_provider crypto] - http 1.2.0 [async http_parser meta web] - idb_shim 2.3.2 [sembast collection path js meta] - intl 0.18.1 [clock meta path] - json_annotation 4.8.1 [meta] - json_serializable 6.7.1 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper] - logger 2.0.2+1 - lottie 3.0.0 [archive flutter path vector_math] - package_info_plus 4.2.0 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface win32] - path_provider 2.1.2 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows] - pdf 3.10.7 [archive barcode bidi crypto image meta path_parsing vector_math xml] - pie_chart 5.4.0 [flutter] - printing 5.11.1 [ffi flutter flutter_web_plugins http image js meta pdf plugin_platform_interface] - qr_flutter 4.1.0 [flutter qr] - raygun4flutter 2.1.0 [connectivity_plus device_info_plus flutter http intl json_annotation network_info_plus package_info_plus path_provider shared_preferences stack_trace uuid] - shared_preferences 2.2.2 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - universal_html 2.2.4 [async csslib charcode collection html meta source_span typed_data universal_io] - url_launcher 6.2.4 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - uuid 4.3.3 [crypto sprintf meta fixnum] - validators 3.0.0 - youtube_player_iframe 2.3.0 [flutter flutter_inappwebview url_launcher] dev dependencies: - analyzer 6.4.1 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml] - bloc_test 9.1.6 [bloc diff_match_patch meta mocktail test] - build_runner 2.4.8 [analyzer args async build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml] - flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math leak_tracker_flutter_testing async boolean_selector characters collection leak_tracker leak_tracker_testing material_color_utilities meta source_span stream_channel string_scanner term_glyph vm_service] - integration_test 0.0.0 [flutter flutter_driver flutter_test path vm_service async boolean_selector characters clock collection fake_async file leak_tracker leak_tracker_flutter_testing leak_tracker_testing matcher material_color_utilities meta source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api vector_math webdriver] - mocktail 1.0.3 [collection matcher test_api] - very_good_analysis 5.1.0 transitive dependencies: - _fe_analyzer_shared 67.0.0 [meta] - _flutterfire_internals 1.3.22 [collection firebase_core firebase_core_platform_interface flutter meta] - args 2.4.2 - barcode 2.2.6 [meta qr] - bidi 2.0.10 - bloc 8.1.3 [meta] - boolean_selector 2.1.1 [source_span string_scanner] - build 2.4.1 [analyzer async convert crypto glob logging meta package_config path] - build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml] - build_daemon 4.0.1 [built_collection built_value crypto http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel] - build_resolvers 2.4.2 [analyzer async build collection convert crypto graphs logging package_config path pool pub_semver stream_transform yaml] - build_runner_core 7.3.0 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta package_config path pool timing watcher yaml] - built_collection 5.1.1 - built_value 8.9.0 [built_collection collection fixnum meta] - characters 1.3.0 - charcode 1.3.1 - checked_yaml 2.0.3 [json_annotation source_span yaml] - clock 1.1.1 - code_builder 4.10.0 [built_collection built_value collection matcher meta] - connectivity_plus 5.0.2 [flutter flutter_web_plugins connectivity_plus_platform_interface js meta nm] - connectivity_plus_platform_interface 1.2.4 [flutter meta plugin_platform_interface] - convert 3.1.1 [typed_data] - coverage 1.7.2 [args logging package_config path source_maps stack_trace vm_service] - crypto 3.0.3 [typed_data] - csslib 1.0.0 [source_span] - dart_style 2.3.4 [analyzer args collection path pub_semver source_span] - dbus 0.7.10 [args ffi meta xml] - device_info_plus 9.1.2 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta win32 win32_registry] - device_info_plus_platform_interface 7.0.0 [flutter meta plugin_platform_interface] - diff_match_patch 0.4.1 - fake_async 1.3.1 [clock collection] - fetch_api 1.0.3 [js] - ffi 2.1.2 - file 7.0.0 [meta path] - firebase_analytics_platform_interface 3.9.6 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.5.5+18 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_auth_platform_interface 7.1.5 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 5.9.5 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser js meta web] - firebase_core_platform_interface 5.0.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_performance_platform_interface 0.1.4+22 [_flutterfire_internals firebase_core flutter plugin_platform_interface] - firebase_performance_web 0.1.4+22 [_flutterfire_internals firebase_core firebase_core_web firebase_performance_platform_interface flutter flutter_web_plugins js] - firebase_remote_config_platform_interface 1.4.22 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - fixnum 1.1.0 - flutter_driver 0.0.0 [file flutter flutter_test fuchsia_remote_debug_protocol path meta vm_service webdriver async boolean_selector characters clock collection leak_tracker leak_tracker_flutter_testing leak_tracker_testing matcher material_color_utilities platform process source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api vector_math] - flutter_inappwebview 5.8.0 [flutter] - flutter_scroll_shadow 1.2.4 [flutter] - frontend_server_client 3.2.0 [async path] - fuchsia_remote_debug_protocol 0.0.0 [process vm_service file meta path platform] - glob 2.1.2 [async collection file path string_scanner] - graphs 2.3.1 [collection] - html 0.15.4 [csslib source_span] - http_multi_server 3.2.1 [async] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - image 4.1.7 [archive meta xml] - io 1.0.4 [meta path string_scanner] - js 0.6.7 [meta] - leak_tracker 10.0.0 [clock collection meta path vm_service] - leak_tracker_flutter_testing 2.0.1 [flutter leak_tracker leak_tracker_testing matcher meta] - leak_tracker_testing 2.0.1 [leak_tracker matcher meta] - linked_scroll_controller 0.2.0 [flutter] - logging 1.2.0 - matcher 0.12.16+1 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.8.0 [collection] - meta 1.11.0 - mime 1.0.5 - nested 1.0.0 [flutter] - network_info_plus 4.1.0+1 [collection nm flutter flutter_web_plugins meta network_info_plus_platform_interface win32 ffi] - network_info_plus_platform_interface 1.1.3 [flutter meta plugin_platform_interface] - nm 0.5.0 [dbus] - node_preamble 2.0.2 - package_config 2.1.0 [path] - package_info_plus_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - path 1.9.0 - path_parsing 1.0.1 [vector_math meta] - path_provider_android 2.2.2 [flutter path_provider_platform_interface] - path_provider_foundation 2.3.2 [flutter path_provider_platform_interface] - path_provider_linux 2.2.1 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_platform_interface 2.1.2 [flutter platform plugin_platform_interface] - path_provider_windows 2.2.1 [ffi flutter path path_provider_platform_interface win32] - petitparser 6.0.2 [meta] - platform 3.1.4 - plugin_platform_interface 2.1.8 [meta] - pointycastle 3.7.4 [collection convert js] - pool 1.5.1 [async stack_trace] - process 5.0.2 [file path platform] - provider 6.1.1 [collection flutter nested] - pub_semver 2.1.4 [collection meta] - pubspec_parse 1.2.3 [checked_yaml collection json_annotation pub_semver yaml] - qr 3.0.1 [meta] - sembast 3.6.0 [meta path synchronized] - shared_preferences_android 2.2.1 [flutter shared_preferences_platform_interface] - shared_preferences_foundation 2.3.5 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.3.2 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_platform_interface 2.3.2 [flutter plugin_platform_interface] - shared_preferences_web 2.2.2 [flutter flutter_web_plugins shared_preferences_platform_interface web] - shared_preferences_windows 2.3.2 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - shelf 1.4.1 [async collection http_parser path stack_trace stream_channel] - shelf_packages_handler 3.0.2 [path shelf shelf_static] - shelf_static 1.1.2 [convert http_parser mime path shelf] - shelf_web_socket 1.0.4 [shelf stream_channel web_socket_channel] - sky_engine 0.0.99 - source_gen 1.5.0 [analyzer async build dart_style glob path source_span yaml] - source_helper 1.3.4 [analyzer collection source_gen] - source_map_stack_trace 2.1.1 [path source_maps stack_trace] - source_maps 0.10.12 [source_span] - source_span 1.10.0 [collection path term_glyph] - sprintf 7.0.0 - stack_trace 1.11.1 [path] - stream_channel 2.1.2 [async] - stream_transform 2.1.0 - string_scanner 1.2.0 [source_span] - sync_http 0.3.1 - synchronized 3.1.0+1 - term_glyph 1.2.1 - test 1.24.9 [analyzer async boolean_selector collection coverage http_multi_server io js matcher node_preamble package_config path pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel test_api test_core typed_data web_socket_channel webkit_inspection_protocol yaml] - test_api 0.6.1 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph] - test_core 0.5.9 [analyzer args async boolean_selector collection coverage frontend_server_client glob io meta package_config path pool source_map_stack_trace source_maps source_span stack_trace stream_channel test_api vm_service yaml] - timing 1.0.1 [json_annotation] - typed_data 1.3.2 [collection] - universal_io 2.2.2 [collection meta typed_data] - url_launcher_android 6.3.0 [flutter url_launcher_platform_interface] - url_launcher_ios 6.2.4 [flutter url_launcher_platform_interface] - url_launcher_linux 3.1.1 [flutter url_launcher_platform_interface] - url_launcher_macos 3.1.0 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.3.2 [flutter plugin_platform_interface] - url_launcher_web 2.2.3 [flutter flutter_web_plugins url_launcher_platform_interface web] - url_launcher_windows 3.1.1 [flutter url_launcher_platform_interface] - vector_math 2.1.4 - vm_service 13.0.0 - watcher 1.1.0 [async path] - web 0.4.2 - web_socket_channel 2.4.3 [async crypto stream_channel web] - webdriver 3.0.3 [matcher path stack_trace sync_http] - webkit_inspection_protocol 1.2.1 [logging] - win32 5.2.0 [ffi] - win32_registry 1.1.2 [ffi win32] - xdg_directories 1.0.4 [meta path] - xml 6.5.0 [collection meta petitparser] - yaml 3.1.2 [collection source_span string_scanner] ```

darshankawar commented 7 months ago

@JaredEzz

There was a recent https://github.com/firebase/flutterfire/issues/12309 and fix made that you can check and see if it helps in your case or not.

google-oss-bot commented 7 months ago

Hey @JaredEzz. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 7 months ago

Since there haven't been any recent updates here, I am going to close this issue.

@JaredEzz if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.