🐛 [FIREBASE_AUTH] twitter signin ios simulator app crashed
Bug report
Hi, The scenario is something like that:
if user is logged in using google provider. And then tried to login using twitter provider with same email. app crashed on ios simulator with the following error.
Unsupported value: <FIROAuthCredential: 0x600001ea9450> of type FIROAuthCredential
but working perfectly fine on android emulator.
Steps to reproduce
- Login to the app using google provider.
- then logout
- Login to the app using twitter provider with the same email used to login using google provider.
- App will crash on ios simulator.
Expected behavior
Expecting Result:
An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.
Actual Result:
Unsupported value: <FIROAuthCredential: 0x600001ea9450> of type FIROAuthCredential
Flutter doctor
Click To Expand
Flutter (Channel stable, 3.13.3, on macOS 12.6.6 21G646 darwin-x64, locale en-AE)
• Flutter version 3.13.3 on channel stable at /Users/mac/Documents/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2524052335 (7 days ago), 2023-09-06 14:32:31 -0700
• Engine revision b8d35810e9
• Dart version 3.1.1
• DevTools version 2.25.0
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at /Users/mac/Library/Android/sdk
• Platform android-34, build-tools 33.0.1
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14C18
• CocoaPods version 1.12.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
[✓] VS Code (version 1.81.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.52.0
[✓] Connected device (4 available)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 13 (API 33) (emulator)
• iPhone 14 Pro Max (mobile) • 362D19F3-892B-4FAC-8856-4E668B131DFF • ios • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
• macOS (desktop) • macos • darwin-x64 • macOS 12.6.6 21G646 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 117.0.5938.62
[✓] Network resources
• All expected network resources are available.
• No issues found!
Flutter dependencies
Click To Expand
dependencies:
- app_settings 5.0.0 [flutter plugin_platform_interface]
- cached_network_image 3.2.3 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web]
- camera 0.10.5+4 [camera_android camera_avfoundation camera_platform_interface camera_web flutter flutter_plugin_android_lifecycle quiver]
- capitalize 0.0.1 [flutter]
- carousel_slider 4.2.1 [flutter]
- country_code_picker 3.0.0 [flutter collection]
- crypto 3.0.3 [typed_data]
- device_info_plus 9.0.3 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta win32 win32_registry]
- device_preview 1.1.0 [flutter flutter_localizations provider device_frame freezed_annotation json_annotation shared_preferences collection]
- dio 5.3.2 [async http_parser meta path]
- dots_indicator 3.0.0 [flutter]
- dotted_line 3.2.2 [flutter]
- draggable_bottom_sheet 1.0.2 [flutter]
- easy_localization 3.0.2 [flutter shared_preferences intl args path easy_logger flutter_localizations]
- expandable 5.0.1 [flutter]
- file_picker 5.5.0 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface ffi path win32]
- firebase_auth 4.8.0 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta]
- firebase_core 2.15.1 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 3.3.5 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- firebase_messaging 14.6.7 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math web sky_engine]
- flutter_launcher_icons 0.13.1 [args checked_yaml cli_util image json_annotation path yaml]
- flutter_local_notifications 15.1.1 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone]
- flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math web]
- flutter_otp_text_field 1.1.1 [flutter]
- flutter_rating_bar 4.0.1 [flutter]
- flutter_riverpod 2.3.7 [collection flutter meta riverpod state_notifier]
- flutter_svg 2.0.7 [flutter vector_graphics vector_graphics_codec vector_graphics_compiler]
- geocoding 2.1.0 [flutter geocoding_platform_interface geocoding_android geocoding_ios]
- google_maps_flutter 2.4.0 [flutter google_maps_flutter_android google_maps_flutter_ios google_maps_flutter_platform_interface google_maps_flutter_web]
- google_sign_in 6.1.4 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web]
- im_stepper 1.0.1+1 [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]
- intl 0.18.1 [clock meta path]
- location 5.0.3 [flutter location_platform_interface location_web]
- map_launcher 2.5.0+1 [flutter]
- package_info_plus 4.1.0 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface win32]
- pinput 3.0.1 [flutter smart_auth universal_platform]
- pull_to_refresh 2.0.0 [flutter]
- riverpod_annotation 2.1.2 [meta riverpod]
- 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]
- shared_preferences 2.2.0 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows]
- sign_in_with_apple 5.0.0 [flutter meta sign_in_with_apple_platform_interface sign_in_with_apple_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]
dev dependencies:
- 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]
- custom_lint 0.5.2 [analyzer analyzer_plugin args async ci cli_util collection freezed_annotation json_annotation meta package_config path pub_semver pubspec_parse rxdart uuid yaml]
- flutter_lints 2.0.2 [lints]
- 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]
- riverpod_generator 2.2.6 [analyzer build build_config collection crypto meta path riverpod_analyzer_utils riverpod_annotation source_gen]
- riverpod_lint 2.0.1 [analyzer analyzer_plugin collection custom_lint_builder meta path riverpod riverpod_analyzer_utils source_span yaml]
transitive dependencies:
- _fe_analyzer_shared 64.0.0 [meta]
- _flutterfire_internals 1.3.5 [collection firebase_core firebase_core_platform_interface flutter meta]
- analyzer 6.2.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- analyzer_plugin 0.11.3 [analyzer collection dart_style pub_semver yaml]
- archive 3.3.7 [crypto path pointycastle]
- args 2.4.2
- async 2.11.0 [collection 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.0 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_resolvers 2.2.1 [analyzer async build collection crypto graphs logging package_config path pool pub_semver stream_transform yaml]
- build_runner_core 7.2.10 [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.2 [built_collection collection fixnum meta]
- cached_network_image_platform_interface 2.0.0 [flutter flutter_cache_manager]
- cached_network_image_web 1.0.2 [flutter flutter_cache_manager cached_network_image_platform_interface]
- camera_android 0.10.8+8 [camera_platform_interface flutter flutter_plugin_android_lifecycle stream_transform]
- camera_avfoundation 0.9.13+4 [camera_platform_interface flutter stream_transform]
- camera_platform_interface 2.5.2 [cross_file flutter plugin_platform_interface stream_transform]
- camera_web 0.3.2+3 [camera_platform_interface flutter flutter_web_plugins stream_transform]
- characters 1.3.0
- checked_yaml 2.0.3 [json_annotation source_span yaml]
- ci 0.1.0
- cli_util 0.4.0 [meta path]
- clock 1.1.1
- code_builder 4.5.0 [built_collection built_value collection matcher meta]
- collection 1.17.2
- convert 3.1.1 [typed_data]
- cross_file 0.3.3+5 [js meta]
- csslib 1.0.0 [source_span]
- custom_lint_builder 0.5.2 [analyzer analyzer_plugin collection custom_lint custom_lint_core glob hotreloader meta path pubspec_parse rxdart]
- custom_lint_core 0.5.2 [analyzer analyzer_plugin collection custom_lint matcher meta path pubspec_parse source_span yaml]
- dart_style 2.3.2 [analyzer args path pub_semver source_span]
- dbus 0.7.8 [args ffi meta xml]
- device_frame 1.1.0 [freezed_annotation flutter]
- device_info_plus_platform_interface 7.0.0 [flutter meta plugin_platform_interface]
- easy_logger 0.0.2 [flutter]
- fake_async 1.3.1 [clock collection]
- ffi 2.1.0
- file 6.1.4 [meta path]
- file_selector_linux 0.9.2+1 [cross_file file_selector_platform_interface flutter]
- file_selector_macos 0.9.3+2 [cross_file file_selector_platform_interface flutter]
- file_selector_platform_interface 2.6.1 [cross_file flutter http plugin_platform_interface]
- file_selector_windows 0.9.3+1 [cross_file file_selector_platform_interface flutter]
- firebase_auth_platform_interface 6.17.0 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_auth_web 5.7.0 [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.7.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_crashlytics_platform_interface 3.6.5 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_platform_interface 4.5.6 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 3.5.6 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta]
- fixnum 1.1.0
- flutter_blurhash 0.7.0 [flutter]
- flutter_cache_manager 3.3.1 [clock collection file flutter http path path_provider rxdart sqflite uuid]
- flutter_local_notifications_linux 4.0.0+1 [dbus ffi flutter flutter_local_notifications_platform_interface path xdg_directories]
- flutter_local_notifications_platform_interface 7.0.0+1 [flutter plugin_platform_interface]
- flutter_plugin_android_lifecycle 2.0.15 [flutter]
- flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math web]
- freezed_annotation 2.4.1 [collection json_annotation meta]
- frontend_server_client 3.2.0 [async path]
- geocoding_android 2.1.2 [flutter geocoding_platform_interface]
- geocoding_ios 2.1.0 [flutter geocoding_platform_interface]
- geocoding_platform_interface 2.0.1 [flutter meta plugin_platform_interface]
- glob 2.1.2 [async collection file path string_scanner]
- google_identity_services_web 0.2.1 [js meta]
- google_maps 6.3.0 [js js_wrapping meta]
- google_maps_flutter_android 2.5.0 [flutter flutter_plugin_android_lifecycle google_maps_flutter_platform_interface stream_transform]
- google_maps_flutter_ios 2.3.0 [flutter google_maps_flutter_platform_interface stream_transform]
- google_maps_flutter_platform_interface 2.4.0 [collection flutter plugin_platform_interface stream_transform]
- google_maps_flutter_web 0.5.4 [collection flutter flutter_web_plugins google_maps google_maps_flutter_platform_interface sanitize_html stream_transform]
- google_sign_in_android 6.1.18 [flutter google_sign_in_platform_interface]
- google_sign_in_ios 5.6.2 [flutter google_sign_in_platform_interface]
- google_sign_in_platform_interface 2.4.1 [flutter plugin_platform_interface quiver]
- google_sign_in_web 0.12.0+3 [flutter flutter_web_plugins google_identity_services_web google_sign_in_platform_interface http js]
- graphs 2.3.1 [collection]
- hotreloader 3.0.6 [collection logging path stream_transform vm_service watcher]
- html 0.15.4 [csslib source_span]
- http 1.1.0 [async http_parser meta]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.2 [collection source_span string_scanner typed_data]
- image 4.0.17 [archive meta xml]
- image_picker_android 0.8.7+5 [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]
- js 0.6.7 [meta]
- js_wrapping 0.7.4 [js]
- json_annotation 4.8.1 [meta]
- 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
- matcher 0.12.16 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.5.0 [collection]
- meta 1.9.1
- mime 1.0.4
- nested 1.0.0 [flutter]
- octo_image 1.0.2 [flutter flutter_blurhash]
- package_config 2.1.0 [path]
- 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 2.1.0 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows]
- path_provider_android 2.1.0 [flutter path_provider_platform_interface]
- path_provider_foundation 2.3.0 [flutter path_provider_platform_interface]
- path_provider_linux 2.2.0 [ffi flutter path path_provider_platform_interface xdg_directories]
- path_provider_platform_interface 2.1.0 [flutter platform plugin_platform_interface]
- path_provider_windows 2.2.0 [ffi flutter path path_provider_platform_interface win32]
- petitparser 5.4.0 [meta]
- platform 3.1.1
- plugin_platform_interface 2.1.5 [meta]
- pointycastle 3.7.3 [collection convert js]
- pool 1.5.1 [async stack_trace]
- 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]
- quiver 3.2.1 [matcher]
- riverpod 2.3.7 [meta stack_trace state_notifier]
- riverpod_analyzer_utils 0.3.3 [analyzer collection crypto custom_lint_core freezed_annotation meta path source_span]
- rxdart 0.27.7
- sanitize_html 2.0.0 [html meta]
- share_plus_platform_interface 3.3.0 [cross_file flutter meta mime plugin_platform_interface path_provider uuid]
- shared_preferences_android 2.2.0 [flutter shared_preferences_platform_interface]
- shared_preferences_foundation 2.3.3 [flutter shared_preferences_platform_interface]
- shared_preferences_linux 2.3.0 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface]
- shared_preferences_platform_interface 2.3.0 [flutter plugin_platform_interface]
- shared_preferences_web 2.2.0 [flutter flutter_web_plugins shared_preferences_platform_interface]
- shared_preferences_windows 2.3.0 [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_web_socket 1.0.4 [shelf stream_channel web_socket_channel]
- sign_in_with_apple_platform_interface 1.0.0 [flutter plugin_platform_interface meta]
- sign_in_with_apple_web 1.0.1 [flutter flutter_web_plugins sign_in_with_apple_platform_interface js]
- sky_engine 0.0.99
- smart_auth 1.1.1 [flutter flutter_web_plugins]
- source_gen 1.4.0 [analyzer async build dart_style glob path source_span yaml]
- 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]
- stack_trace 1.11.0 [path]
- state_notifier 1.0.0 [meta]
- stream_channel 2.1.1 [async]
- stream_transform 2.1.0
- string_scanner 1.2.0 [source_span]
- synchronized 3.1.0
- term_glyph 1.2.1
- test_api 0.6.0 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- timezone 0.9.2 [path]
- timing 1.0.1 [json_annotation]
- typed_data 1.3.2 [collection]
- universal_platform 1.0.0+1
- 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.19 [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
- vm_service 11.10.0
- watcher 1.1.0 [async path]
- web 0.1.4-beta
- web_socket_channel 2.4.0 [async crypto stream_channel]
- win32 5.0.7 [ffi]
- win32_registry 1.1.1 [ffi win32]
- xdg_directories 1.0.2 [meta path]
- xml 6.3.0 [collection meta petitparser]
- yaml 3.1.2 [collection source_span string_scanner]
Hi @abubakarmvp, there is a new version of firebase_auth, can you upgrade to this version (4.9.0) to see if you still face this issue?
Hi @danagbemava-nc, yes issue still exist even on latest firebase_Auth version.
Hi @abubakarmvp, is it only with the twitter provider? Or you get this issue when you try to sign in with an existing email from any provider?
App contains google and twitter signin only. With Google signin i did not face any issue. but with twitter app is crashing. But if i enable "Create multiple accounts for each identity provider" option from console. then there is no crash.
I used email/password sign in and google sign in but I don't get a proper error message although the application didn't exactly crash. This is worth investigating.
cc @Lyokone
Hi @danagbemava-nc, As you can see in the video, On twitter signin app is crashed.
https://github.com/firebase/flutterfire/assets/103175184/ac3b4bab-0454-49fd-ad68-266fe23e1f47
I think this might've been fixed with this PR, but I would like to confirm. Can you provide a repro code sample for me to test, please, @abubakarmvp
Getting this exact same error while linking a Google provider after an initial sign up with SMS. I have 100% reproduction rate (did not have this problem initially tho, I had some successful linking, I will now try to clean simulator data and report back)
Unsupported value: <FIROAuthCredential: 0x600001ea9450> of type FIROAuthCredential
Unfortunately I do not have reproducible code to share as the code at stake is too deep in my app logic.
I also get this:
Lost connection to device.
Exception: Unable to terminate com.redacted.redacted on BD5A0...................DF0D:
ProcessException: Process exited abnormally:
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
Simulator device returned an error for the requested operation.
found nothing to terminate
Underlying error (domain=NSPOSIXErrorDomain, code=3):
The request to terminate "com.oneappatatime.top" failed. found nothing to terminate
found nothing to terminate
Command: /usr/bin/arch -arm64e xcrun simctl terminate BD5A0...................DF0D: com.redacted.redacted
I managed to replicate again, to me the way to fix is NOT to clean the iPhone simulator (i.e. Device > Erase All Contents and Settings) but
The solutions is to stop the Firebase emulator and then start it again with firebase emulators:start
I'm seeing the same issue on iOS simulator when attempting to convert Firebase email password users to Microsoft sign in. This has been reported by our production users on physical devices as well. As far as I've tested the 4.11.1 updates haven't fixed this problem. Will test on Android as well.
Looks like this issue is only happening for me on iOS simulators or devices (tested with the 4.12.0 firebase_auth package). No issue found on Android device. @russellwheatley
Also tested this with email enumeration turned on/off and that didn't change anything.
Looks like this issue was introduced in firebase_auth 4.7.0 as downgrading to 4.6.3 works fine for me, but upgrading to 4.7.0 causes the crash to start appearing. @mariopepe @danagbemava-nc
Very interesting thanks so much for sharing @deffs
I also downgraded firebase_storage like yesterday because the newest version with pigeon crashes when using the firebase emulator and hot restarting the app 😞
This pigeon thing is very dangerous, it doesn't just throw errors, but it crashes and closes the app. I will personally revert back all firebase related packages to before any pigeon at all was in use.
Could we get some feedback from Firebase on this. This is a breaking issue for all my new iOS users. @Lyokone @russellwheatley
Hi 👋 On the latest version, I cannot reproduce; Can you provide a full reproduction project?
I will test this again today. To confirm, what is the latest version you are using? Auth 4.12.1?
@Lyokone this is still crashing for me on iOS simulators & devices when using firebase_auth 4.12.1 with the latest Firebase Flutter packages. What I am trying to do is sign in to a previously created email/password user and convert them to a Microsoft provider user.
First, sign in to the user with the signInWithEmailAndPassword method (that works successfully).
Second, I attempt to sign the user in with a provider signInWithProvider(getMicrosoftProvider()) (Microsoft provider in my case). When I attempt to sign in with provider that causes an exception and then crash due to Unsupported value: <FIROAuthCredential: 0x60000217bf70> of type FIROAuthCredential. As far as I've tested when I call this method by itself signInWithProvider(getMicrosoftProvider()) it crashes (maybe because the user doesn't have that provider linked?).
Microsoft provider is set to:
MicrosoftAuthProvider getMicrosoftProvider() {
final microsoftProvider = MicrosoftAuthProvider();
microsoftProvider.setCustomParameters({
'tenant': 'xxx',
'login_hint': enteredEmail
});
return microsoftProvider;
}
Looks like linkWithProvider(getMicrosoftProvider()) works successfully and returns the expected credential. Thus I think I can work around this crash using the link instead of signIn method. @mariopepe @abubakarmvp.
@deffs I'm wondering if it's due to this setting in the console:
If the user has already created an account, you might have to link it.
Hi @Lyokone, My major concern is app should not crash on IOS even the accounts are not linked successfully. Because on Android, i am getting exception but the app is not crashing.
Ya I agree with @abubakarmvp on Android it's not crashing and it wasn't previously crashing on iOS. This crash is blocking me from turning on email enumeration protection since we can no longer use "fetchSignInMethodsForEmail" @Lyokone
As noted here, I cannot reproduce the issue, do you mind providing a full reproduction example so I can check what's going on? Thanks
It's a very simple example, but I'm having the same issue today. It seems to only be occurring if the email I'm signing in with to Microsoft already has an account created in Firebase using another provider (in my case I had signed in already with Google using the same email).
Once I delete the user from Firebase, I can successfully log in using Microsoft.
Under the Settings tab in Firebase Auth, I also have set "Link accounts that use the same email".
try {
final microsoftProvider = MicrosoftAuthProvider();
final UserCredential userCredential =
await FirebaseAuth.instance.signInWithProvider(microsoftProvider);
return userCredential;
} on FirebaseAuthException catch (e) {
print(e);
}
Ya I was seeing the issue the same way on iOS devices and simulators.
- Create a new email/password user
- Attempt to sign-in as that user using
signInWithProviderwith a Microsoft provider.
I can try to create an example Flutter project that replicates this issue.
@Lyokone I tried creating a sample project that replicates the issue, but I was only able to get it to crash when attempting to sign-in to Microsoft using my company's "tenant" and Microsoft Active Directory setup. If I use a generic Microsoft provider (like one I created for the example project it doesn't crash). The only differences in our Azure setup is my project supports "All Microsoft Account Users" and my company's is "My Organization Only". I'm not sure how to replicate the scenario exactly, but for whatever reason the credential is coming back differently and cannot be parsed correctly by Firebase Auth. Sign in works fine after a user has been successfully linked to Microsoft. @LampeMW is there a special way you were creating your Microsoft Provider?
Hi @deffs, thanks for the investigation, that is probably why I wasn't able to reproduce this issue with our own Microsoft account. I'll see if I can find a way to reproduce this issue.
Sometimes I do get this error when I just call await FirebaseAuth.instance.currentUser?.linkWithProvider(...) so even before Google can make any evaluation regarding my email etc. Deleting the app and trying again fixes it, I wonder in production what happens.
Hey @abubakarmvp. 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 I think we provided as much information as possible and are waiting on feedback from the Firebase team, please don't mark this issue as stale or close it
@Lyokone Tried to replicate the problem on firebase_auth 4.15.0 and it is still crashing for me. I thought https://github.com/firebase/flutterfire/pull/11889 might resolve the issue with the Unsupported value of FIROAuthCredential, but it is still a crashing error in this version.