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.51k stars 3.92k forks source link

πŸ› [firebase_app_check] Can't use Flutter Web with App Check for Authentication enforced. User logs out on initial page load. #11716

Closed drklrd56 closed 8 months ago

drklrd56 commented 8 months ago

Bug report

Describe the bug When enforcing App Check for Authentication on Firebase, I can connect my Flutter App and login users using phone authentication.

If I refresh the page after the user logs in a Flutter web application with App Check for authentication enforced, I get a 401 error:

https://identitytoolkit.googleapis.com/v1/accounts:lookup?key=***************** 401

User credentials are cleared from local storage on 401 and the user has to login again on page refresh.

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to Firebase and enforce App Check for Authentication
  2. Run you App for Flutter Web (Firebase App Check needs to be set up).
  3. Log in with phone authentication.
  4. Refresh the web app.

Expected behavior

User should be logged in to my app after the refresh, but I get an App Check error instead and the user credentials are wiped out from the local storage

Sample project

I cannot provide the login flow using mobile authentication but below is my main.dart. I think this is more than enough to recreate the issue. The login flow using phone-auth needs time to be implemented even for an example. I don't have time for that.

Future<void> main() async {
      usePathUrlStrategy();
      FirebaseOptions options =
          DefaultFirebaseOptions.currentPlatform;
      await Firebase.initializeApp(options: options);
      await FirebaseAppCheck.instance.activate(
        webProvider:
            ReCaptchaV3Provider('site-key'),
      );
     FirebaseAuth.instance
          .authStateChanges()
          .distinct((first, second) => first?.uid == second?.uid);
      runApp(App());
}

Additional context

https://identitytoolkit.googleapis.com/v1/accounts:lookup?key=*****************

I checked the network requests and found out that the X-Firebase-Appcheck is present in the headers for the request url above but it's missing after the page refresh. As the app check token is missing the request is rejected (401) due to enforcement.

Request screenshots of login request using phone authentication

Screenshot 2023-10-17 at 4 57 22 PM Screenshot 2023-10-17 at 4 57 09 PM

Screenshots of the login request after page refresh

Screenshot 2023-10-17 at 4 57 38 PM Screenshot 2023-10-17 at 4 57 52 PM

Flutter doctor

Click To Expand ``` octor summary (to see all details, run flutter doctor -v): [!] Flutter (Channel stable, 3.13.2, on macOS 13.5.2 22G91 darwin-arm64, locale en-PK) ! Warning: `flutter` on your path resolves to /Library/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /library/flutter. Consider adding /library/flutter/bin to the front of your path. ! Warning: `dart` on your path resolves to /Library/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /library/flutter. Consider adding /library/flutter/bin to the front of your path. [βœ“] Android toolchain - develop for Android devices (Android SDK version 32.0.0) [βœ“] Xcode - develop for iOS and macOS (Xcode 15.0) [βœ“] Chrome - develop for the web [βœ“] Android Studio (version 2021.2) [βœ“] VS Code (version 1.83.1) [βœ“] Connected device (2 available) ! Error: Browsing on the local area network for Ali’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) [βœ“] Network resources ! Doctor found issues in 1 category. ```

Flutter dependencies

Click To Expand ``` Dart SDK 3.1.0 Flutter SDK 3.13.2 clubsocial 2.4.2+38 dependencies: - add_2_calendar 2.2.4 [flutter] - args 2.4.2 - bloc 8.1.2 [meta] - cached_network_image 3.3.0 [cached_network_image_platform_interface cached_network_image_web flutter flutter_cache_manager octo_image] - connectivity_plus 5.0.0 [flutter flutter_web_plugins connectivity_plus_platform_interface js meta nm] - contacts_service 0.6.3 [flutter collection quiver] - cross_file 0.3.3+5 [js meta] - csv 5.0.2 - cupertino_icons 1.0.6 - currency_symbols 0.0.1+2 [flutter] - date_time_format 2.0.1 - device_info_plus 9.0.3 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta win32 win32_registry] - devicelocale 0.6.0 [flutter flutter_web_plugins] - dio 5.3.3 [async http_parser meta path] - equatable 2.0.5 [collection meta] - extended_nested_scroll_view 6.1.2 [flutter visibility_detector] - file 6.1.4 [meta path] - file_picker 5.5.0 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface ffi path win32] - firebase_analytics 10.5.0 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_app_check 0.2.0+1 [firebase_app_check_platform_interface firebase_app_check_web firebase_core firebase_core_platform_interface flutter] - firebase_auth 4.10.1 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 2.17.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 3.3.7 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_messaging 14.6.8 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - firebase_remote_config 4.2.6 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface firebase_remote_config_web flutter] - flex_color_scheme 7.3.1 [flex_seed_scheme flutter meta] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math web sky_engine] - flutter_bloc 8.1.3 [bloc flutter provider] - flutter_cache_manager 3.3.1 [clock collection file flutter http path path_provider rxdart sqflite uuid] - flutter_credit_card 3.0.7 [flutter] - flutter_form_builder 9.1.1 [flutter intl] - flutter_image_compress 2.0.4 [flutter flutter_image_compress_platform_interface flutter_image_compress_common flutter_image_compress_web] - flutter_libphonenumber 2.1.5 [flutter flutter_libphonenumber_android flutter_libphonenumber_ios flutter_libphonenumber_platform_interface flutter_libphonenumber_web] - flutter_markdown 0.6.17+3 [flutter markdown meta path] - flutter_native_timezone 2.0.0 [flutter_web_plugins flutter js] - flutter_overlay_loader 2.0.0 [flutter] - flutter_svg 2.0.7 [flutter vector_graphics vector_graphics_codec vector_graphics_compiler] - flutter_typeahead 4.8.0 [flutter flutter_keyboard_visibility pointer_interceptor] - fluttertoast 8.2.2 [flutter flutter_web_plugins] - font_awesome_flutter 10.3.0 [flutter] - form_builder_validators 9.1.0 [flutter flutter_localizations intl] - freezed_annotation 2.4.1 [collection json_annotation meta] - geolocator 10.1.0 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web geolocator_windows] - gleap_sdk 11.2.0 [flutter flutter_web_plugins js json_annotation] - go_router 10.2.0 [collection flutter flutter_web_plugins logging meta] - google_api_availability 5.0.0 [flutter google_api_availability_android google_api_availability_platform_interface] - google_api_headers 2.0.2 [flutter package_info_plus] - google_maps_flutter 2.5.0 [flutter google_maps_flutter_android google_maps_flutter_ios google_maps_flutter_platform_interface google_maps_flutter_web] - google_maps_webservice 2.0.0 [http meta json_annotation] - helpers 1.2.3 [flutter vector_math] - hive 2.2.3 [meta crypto] - hive_flutter 1.1.0 [flutter hive path_provider path] - image_cropper 5.0.0 [flutter image_cropper_platform_interface image_cropper_for_web] - in_app_update 4.2.1 [flutter] - infinite_scroll_pagination 4.0.0 [flutter flutter_staggered_grid_view sliver_tools] - intl 0.18.1 [clock meta path] - intl_phone_number_input 0.7.3+1 [flutter libphonenumber_plugin equatable collection] - jiffy 6.2.1 [intl] - json_serializable 6.7.1 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper] - list_tile_switch 1.0.0 [flutter] - location 5.0.3 [flutter location_platform_interface location_web] - logger 2.0.2+1 - markdown 7.1.1 [args meta] - mime 1.0.4 - mobile_scanner 3.4.1 [flutter flutter_web_plugins js] - onesignal_flutter 3.5.0 [flutter] - path_provider 2.1.1 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows] - permission_handler 10.4.5 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface] - photo_view 0.14.0 [flutter] - pull_to_refresh 2.0.0 [flutter] - qr_flutter 4.1.0 [flutter qr] - quiver 3.2.1 [matcher] - read_more_text 0.0.5 [flutter] - recase 4.1.0 - responsive_builder 0.7.0 [flutter provider] - responsive_framework 0.2.0 [flutter collection] - roundcheckbox 2.0.5 [flutter] - rxdart 0.27.7 - screenshot 2.1.0 [flutter] - shake 2.2.0 [sensors_plus flutter] - share_plus 7.1.0 [cross_file meta mime flutter flutter_web_plugins share_plus_platform_interface file url_launcher_web url_launcher_windows url_launcher_linux url_launcher_platform_interface ffi win32] - social_share 2.3.2 [flutter path_provider] - store_redirect 2.0.1 [flutter] - stream_chat_flutter 6.11.0 [cached_network_image chewie collection contextmenu dart_vlc desktop_drop diacritic dio ezanimation file_picker file_selector flutter flutter_markdown flutter_portal flutter_svg http_parser image_gallery_saver image_picker jiffy lottie meta path_provider photo_manager photo_view rxdart share_plus shimmer stream_chat_flutter_core synchronized thumblr url_launcher video_player video_thumbnail] - stream_chat_flutter_core 6.10.0 [collection connectivity_plus flutter freezed_annotation meta rxdart stream_chat] - stream_chat_persistence 6.9.0 [drift flutter logging meta path path_provider sqlite3_flutter_libs stream_chat] - timeago 3.5.0 [intl] - uni_links 0.5.1 [flutter uni_links_platform_interface uni_links_web] - url_launcher 6.1.14 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - validators 3.0.0 - video_compress 3.1.2 [flutter] - video_editor 2.4.0 [flutter ffmpeg_kit_flutter_min_gpl path path_provider transparent_image video_player video_thumbnail] - video_player 2.7.2 [flutter html video_player_android video_player_avfoundation video_player_platform_interface video_player_web] - visibility_detector 0.4.0+2 [flutter] - wechat_assets_picker 8.7.1 [flutter extended_image photo_manager provider video_player] dev dependencies: - bloc_test 9.1.4 [bloc diff_match_patch meta mocktail test] - build_runner 2.4.6 [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_launcher_icons 0.13.1 [args checked_yaml cli_util image json_annotation path yaml] - flutter_lints 2.0.3 [lints] - flutter_native_splash 2.3.2 [args flutter flutter_web_plugins js html image meta path universal_io xml yaml] - flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math async boolean_selector characters collection material_color_utilities meta source_span stream_channel string_scanner term_glyph web] - freezed 2.4.1 [analyzer build build_config collection meta source_gen freezed_annotation json_annotation] - hive_generator 2.0.1 [build source_gen hive analyzer source_helper] - integration_test 0.0.0 [flutter flutter_driver flutter_test path vm_service async boolean_selector characters clock collection fake_async file matcher material_color_utilities meta source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api vector_math web webdriver] dependency overrides: - connectivity_plus 5.0.0 [flutter flutter_web_plugins connectivity_plus_platform_interface js meta nm] - ffmpeg_kit_flutter_min_gpl 5.1.0 [ffmpeg_kit_flutter_platform_interface flutter] transitive dependencies: - _fe_analyzer_shared 61.0.0 [meta] - _flutterfire_internals 1.3.7 [collection firebase_core firebase_core_platform_interface flutter meta] - after_layout 1.2.0 [flutter] - analyzer 5.13.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml] - animations 2.0.8 [flutter] - archive 3.4.2 [crypto path pointycastle] - asn1lib 1.5.0 - async 2.11.0 [collection meta] - audio_video_progress_bar 0.11.0 [flutter] - 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.0 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel] - build_resolvers 2.4.1 [analyzer async build collection convert crypto graphs logging package_config path pool pub_semver stream_transform yaml] - build_runner_core 7.2.11 [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.6.3 [built_collection collection fixnum meta] - cached_network_image_platform_interface 3.0.0 [flutter flutter_cache_manager] - cached_network_image_web 1.1.0 [cached_network_image_platform_interface flutter flutter_cache_manager] - characters 1.3.0 - checked_yaml 2.0.3 [json_annotation source_span yaml] - chewie 1.7.1 [cupertino_icons flutter provider video_player wakelock_plus] - cli_util 0.4.0 [meta path] - clock 1.1.1 - code_builder 4.6.0 [built_collection built_value collection matcher meta] - collection 1.17.2 - connectivity_plus_platform_interface 1.2.4 [flutter meta plugin_platform_interface] - contextmenu 3.0.0 [flutter animations after_layout] - convert 3.1.1 [typed_data] - coverage 1.6.3 [args logging package_config path source_maps stack_trace vm_service] - crypto 3.0.3 [typed_data] - crypto_keys 0.3.0+1 [pointycastle meta collection quiver] - csslib 1.0.0 [source_span] - dart_style 2.3.2 [analyzer args path pub_semver source_span] - dart_vlc 0.4.0 [flutter dart_vlc_ffi path audio_video_progress_bar] - dart_vlc_ffi 0.2.0+1 [ffi path] - dbus 0.7.8 [args ffi meta xml] - desktop_drop 0.4.3 [flutter flutter_web_plugins cross_file] - device_info_plus_platform_interface 7.0.0 [flutter meta plugin_platform_interface] - diacritic 0.1.4 - diff_match_patch 0.4.1 - drift 2.12.0 [async convert collection js meta stream_channel sqlite3 path] - extended_image 8.1.1 [extended_image_library flutter meta] - extended_image_library 3.6.0 [crypto flutter http_client_helper js path path_provider] - ezanimation 0.6.0 [flutter] - fake_async 1.3.1 [clock collection] - ffi 2.1.0 - ffmpeg_kit_flutter_platform_interface 0.2.1 [flutter plugin_platform_interface] - file_selector 1.0.1 [file_selector_android file_selector_ios file_selector_linux file_selector_macos file_selector_platform_interface file_selector_web file_selector_windows flutter] - file_selector_android 0.5.0+3 [file_selector_platform_interface flutter plugin_platform_interface] - file_selector_ios 0.5.1+6 [file_selector_platform_interface flutter] - file_selector_linux 0.9.2+1 [cross_file file_selector_platform_interface flutter] - file_selector_macos 0.9.3+3 [cross_file file_selector_platform_interface flutter] - file_selector_platform_interface 2.6.1 [cross_file flutter http plugin_platform_interface] - file_selector_web 0.9.2+1 [file_selector_platform_interface flutter flutter_web_plugins] - file_selector_windows 0.9.3+1 [cross_file file_selector_platform_interface flutter] - firebase_analytics_platform_interface 3.7.0 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.5.5 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_app_check_platform_interface 0.1.0+1 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_app_check_web 0.1.0+1 [_flutterfire_internals firebase_app_check_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_auth_platform_interface 6.19.1 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 5.8.2 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser js meta] - firebase_core_platform_interface 4.8.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.8.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 3.6.7 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_messaging_platform_interface 4.5.7 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 3.5.7 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - firebase_remote_config_platform_interface 1.4.6 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_remote_config_web 1.4.6 [firebase_core firebase_core_web firebase_remote_config_platform_interface flutter flutter_web_plugins js] - fixnum 1.1.0 - flex_seed_scheme 1.4.0 [collection flutter meta] - flutter_driver 0.0.0 [file flutter flutter_test fuchsia_remote_debug_protocol path meta vm_service webdriver async boolean_selector characters clock collection matcher material_color_utilities platform process source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api vector_math web] - flutter_image_compress_common 1.0.2 [flutter flutter_image_compress_platform_interface] - flutter_image_compress_platform_interface 1.0.2 [flutter plugin_platform_interface cross_file] - flutter_image_compress_web 0.1.3+1 [flutter flutter_web_plugins flutter_image_compress_platform_interface js] - flutter_keyboard_visibility 5.4.1 [meta flutter_keyboard_visibility_platform_interface flutter_keyboard_visibility_linux flutter_keyboard_visibility_macos flutter_keyboard_visibility_web flutter_keyboard_visibility_windows flutter] - flutter_keyboard_visibility_linux 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_keyboard_visibility_macos 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_keyboard_visibility_platform_interface 2.0.0 [flutter meta plugin_platform_interface] - flutter_keyboard_visibility_web 2.0.0 [flutter_keyboard_visibility_platform_interface flutter_web_plugins flutter] - flutter_keyboard_visibility_windows 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_libphonenumber_android 1.0.1 [flutter flutter_libphonenumber_platform_interface] - flutter_libphonenumber_ios 1.1.4 [flutter flutter_libphonenumber_platform_interface] - flutter_libphonenumber_platform_interface 1.0.0 [flutter plugin_platform_interface] - flutter_libphonenumber_web 1.0.0 [flutter flutter_web_plugins flutter_libphonenumber_platform_interface js] - flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math web] - flutter_plugin_android_lifecycle 2.0.16 [flutter] - flutter_portal 1.1.4 [collection flutter vector_math] - flutter_staggered_grid_view 0.7.0 [flutter] - flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math web] - frontend_server_client 3.2.0 [async path] - fuchsia_remote_debug_protocol 0.0.0 [process vm_service file meta path platform] - geolocator_android 4.3.0 [flutter geolocator_platform_interface uuid] - geolocator_apple 2.3.2 [flutter geolocator_platform_interface] - geolocator_platform_interface 4.1.0 [flutter plugin_platform_interface vector_math meta] - geolocator_web 2.2.0 [flutter flutter_web_plugins geolocator_platform_interface] - geolocator_windows 0.2.1 [flutter geolocator_platform_interface] - glob 2.1.2 [async collection file path string_scanner] - google_api_availability_android 1.0.1 [flutter google_api_availability_platform_interface] - google_api_availability_platform_interface 1.0.1 [flutter plugin_platform_interface meta] - google_maps 6.3.0 [js js_wrapping meta] - google_maps_flutter_android 2.5.1 [flutter flutter_plugin_android_lifecycle google_maps_flutter_platform_interface stream_transform] - google_maps_flutter_ios 2.3.1 [flutter google_maps_flutter_platform_interface stream_transform] - google_maps_flutter_platform_interface 2.4.1 [collection flutter plugin_platform_interface stream_transform] - google_maps_flutter_web 0.5.4+2 [collection flutter flutter_web_plugins google_maps google_maps_flutter_platform_interface sanitize_html stream_transform] - graphs 2.3.1 [collection] - html 0.15.4 [csslib source_span] - http 1.1.0 [async http_parser meta] - http_client_helper 3.0.0 [http] - http_multi_server 3.2.1 [async] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - image 4.1.2 [archive meta xml] - image_cropper_for_web 3.0.0 [flutter flutter_web_plugins image_cropper_platform_interface js] - image_cropper_platform_interface 5.0.0 [flutter plugin_platform_interface http] - image_gallery_saver 2.0.3 [flutter] - image_picker 1.0.4 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_linux image_picker_macos image_picker_platform_interface image_picker_windows] - image_picker_android 0.8.8+1 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface] - image_picker_for_web 3.0.1 [flutter flutter_web_plugins image_picker_platform_interface mime] - image_picker_ios 0.8.8+2 [flutter image_picker_platform_interface] - image_picker_linux 0.2.1+1 [file_selector_linux file_selector_platform_interface flutter image_picker_platform_interface] - image_picker_macos 0.2.1+1 [file_selector_macos file_selector_platform_interface flutter image_picker_platform_interface] - image_picker_platform_interface 2.9.1 [cross_file flutter http plugin_platform_interface] - image_picker_windows 0.2.1+1 [file_selector_platform_interface file_selector_windows flutter image_picker_platform_interface] - io 1.0.4 [meta path string_scanner] - jose 0.3.4 [crypto_keys meta typed_data x509 http http_parser asn1lib collection] - js 0.6.7 [meta] - js_wrapping 0.7.4 [js] - json_annotation 4.8.1 [meta] - libphonenumber_platform_interface 0.4.1 [flutter plugin_platform_interface] - libphonenumber_plugin 0.3.2 [flutter flutter_web_plugins libphonenumber_platform_interface libphonenumber_web] - libphonenumber_web 0.3.1 [flutter flutter_web_plugins js libphonenumber_platform_interface] - lints 2.1.1 - location_platform_interface 3.1.2 [flutter plugin_platform_interface] - location_web 4.2.0 [flutter flutter_web_plugins http_parser js location_platform_interface] - logging 1.2.0 - lottie 2.6.0 [archive flutter path vector_math] - matcher 0.12.16 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.5.0 [collection] - meta 1.9.1 - mocktail 1.0.0 [collection matcher test] - nested 1.0.0 [flutter] - nm 0.5.0 [dbus] - node_preamble 2.0.2 - octo_image 2.0.0 [flutter] - package_config 2.1.0 [path] - package_info_plus 4.1.0 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface win32] - package_info_plus_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - path 1.8.3 - path_parsing 1.0.1 [vector_math meta] - path_provider_android 2.2.0 [flutter path_provider_platform_interface] - path_provider_foundation 2.3.1 [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.1 [flutter platform plugin_platform_interface] - path_provider_windows 2.2.1 [ffi flutter path path_provider_platform_interface win32] - permission_handler_android 10.3.6 [flutter permission_handler_platform_interface] - permission_handler_apple 9.1.4 [flutter permission_handler_platform_interface] - permission_handler_platform_interface 3.11.5 [flutter meta plugin_platform_interface] - permission_handler_windows 0.1.3 [flutter permission_handler_platform_interface] - petitparser 5.4.0 [meta] - photo_manager 2.7.1 [flutter] - platform 3.1.0 - plugin_platform_interface 2.1.6 [meta] - pointer_interceptor 0.9.3+6 [flutter] - pointycastle 3.7.3 [collection convert js] - pool 1.5.1 [async stack_trace] - process 4.2.4 [file path platform] - provider 6.0.5 [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] - rate_limiter 1.0.0 - sanitize_html 2.0.0 [html meta] - sensors_plus 1.4.1 [flutter sensors_plus_web sensors_plus_platform_interface] - sensors_plus_platform_interface 1.1.3 [flutter meta plugin_platform_interface] - sensors_plus_web 1.1.2 [flutter sensors_plus_platform_interface flutter_web_plugins] - share_plus_platform_interface 3.3.0 [cross_file flutter meta mime plugin_platform_interface path_provider uuid] - 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] - shimmer 3.0.0 [flutter] - sky_engine 0.0.99 - sliver_tools 0.2.12 [flutter] - source_gen 1.4.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] - sqflite 2.3.0 [flutter sqflite_common path] - sqflite_common 2.5.0 [synchronized path meta] - sqlite3 2.1.0 [collection ffi js meta path] - sqlite3_flutter_libs 0.5.17 [flutter] - stack_trace 1.11.0 [path] - stream_channel 2.1.1 [async] - stream_chat 6.9.0 [async collection dio equatable freezed_annotation http_parser jose json_annotation logging meta mime rate_limiter rxdart synchronized uuid web_socket_channel] - stream_transform 2.1.0 - string_scanner 1.2.0 [source_span] - sync_http 0.3.1 - synchronized 3.1.0 - term_glyph 1.2.1 - test 1.24.3 [analyzer async boolean_selector collection coverage http_multi_server io js node_preamble package_config path pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel typed_data web_socket_channel webkit_inspection_protocol yaml test_api test_core matcher] - test_api 0.6.0 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph] - test_core 0.5.3 [analyzer async args 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 vm_service yaml test_api] - thumblr 0.0.4 [flutter thumblr_platform_interface thumblr_macos thumblr_windows] - thumblr_macos 0.4.0 [flutter thumblr_platform_interface] - thumblr_platform_interface 0.3.1+1 [flutter plugin_platform_interface] - thumblr_windows 0.0.3+1 [flutter thumblr_platform_interface path_provider] - timing 1.0.1 [json_annotation] - transparent_image 2.0.1 - typed_data 1.3.2 [collection] - uni_links_platform_interface 1.0.0 [flutter plugin_platform_interface] - uni_links_web 0.1.0 [flutter flutter_web_plugins uni_links_platform_interface] - universal_io 2.2.2 [collection meta typed_data] - url_launcher_android 6.1.0 [flutter url_launcher_platform_interface] - url_launcher_ios 6.1.5 [flutter url_launcher_platform_interface] - url_launcher_linux 3.0.6 [flutter url_launcher_platform_interface] - url_launcher_macos 3.0.7 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.1.5 [flutter plugin_platform_interface] - url_launcher_web 2.0.20 [flutter flutter_web_plugins url_launcher_platform_interface] - url_launcher_windows 3.0.8 [flutter url_launcher_platform_interface] - uuid 3.0.7 [crypto] - vector_graphics 1.1.7 [flutter vector_graphics_codec] - vector_graphics_codec 1.1.7 - vector_graphics_compiler 1.1.7 [args meta path_parsing xml vector_graphics_codec] - vector_math 2.1.4 - video_player_android 2.4.10 [flutter video_player_platform_interface] - video_player_avfoundation 2.4.10 [flutter video_player_platform_interface] - video_player_platform_interface 6.2.1 [flutter plugin_platform_interface] - video_player_web 2.1.0 [flutter flutter_web_plugins video_player_platform_interface] - video_thumbnail 0.5.3 [flutter] - vm_service 11.7.1 - wakelock_plus 1.1.1 [flutter flutter_web_plugins meta wakelock_plus_platform_interface win32 dbus package_info_plus js] - wakelock_plus_platform_interface 1.1.0 [flutter plugin_platform_interface meta] - watcher 1.1.0 [async path] - web 0.1.4-beta - web_socket_channel 2.4.0 [async crypto stream_channel] - webdriver 3.0.2 [matcher path stack_trace sync_http] - webkit_inspection_protocol 1.2.1 [logging] - win32 5.0.8 [ffi] - win32_registry 1.1.2 [ffi win32] - x509 0.2.3 [asn1lib quiver crypto_keys] - xdg_directories 1.0.3 [meta path] - xml 6.3.0 [collection meta petitparser] - yaml 3.1.2 [collection source_span string_scanner] ```

darshankawar commented 8 months ago

Thanks for the report @drklrd56 Can you take a look at this similar issue and a fix made recently to see if it helps in your case or not ?

drklrd56 commented 8 months ago

yes the issue is the same as mine. The fix was merged in master last week though. I guess I need to wait for the new version release for firebase_core and firebase_app_check on pub.dev for the issue to be properly resolved in packages. In the meantime I can do a direct git package import for the packages to use the latest source code.

Anyways thanks for the help @darshankawar

Edit: The issue is fixed in the latest package versions for firebase_core(v2.18.0) and firebase_app_check(0.21.0).Both versions were released a few hours after I opened the issue.. πŸ˜‚

drklrd56 commented 8 months ago

Hey, I opened the issue again. Firebase auth 401 is not happening on page refresh anymore but it's happening on initial page load with app_check v.0.2.1 on flutter v.3.13.8

The issue is the same as described above but it's happening on initial page load. The app check token is not used for the very first call.

https://identitytoolkit.googleapis.com/v1/accounts:lookup?key=***************** 401

drklrd56 commented 8 months ago

As there is no response for days, I am closing this issue and opening a new one