Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [flutterfire_ui] GoogleProviderConfiguration.clientId should be nullable #8440

Closed
blaugold opened this issue Apr 9, 2022 · 7 comments · Fixed by #9343
Closed

🐛 [flutterfire_ui] GoogleProviderConfiguration.clientId should be nullable #8440

blaugold opened this issue Apr 9, 2022 · 7 comments · Fixed by #9343
Assignees
Labels
platform: ios Issues / PRs which are specifically for iOS. platform: web Issues / PRs which are specifically for web. plugin: ui resolution: fixed A fix has been merged or is pending merge from a PR. type: bug Something isn't working

Comments

@blaugold
Copy link
Contributor

blaugold commented Apr 9, 2022

Bug report

Describe the bug

When GoogleProviderConfiguration.clientId is always set to the Web client ID, as suggested by the docs for GoogleProviderConfiguration, the app crashes on iOS during sign in because the Web client ID does not match the iOS client ID. GoogleSignIn officially only supports clientId for the Web platform, but seems to initialize the native SDKs with it as well.

A better name for the property might have been GoogleProviderConfiguration.webClientId which would only be passed to GoogleSignIn on the Web platform, since the other platforms don't require manual specification of the client ID anyway.


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 2.13.0-0.0.pre.406, on macOS 12.3.1 21E258 darwin-arm, locale en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] IntelliJ IDEA Community Edition (version 2021.3.3)
[✓] VS Code (version 1.66.1)
[✓] Connected device (4 available)
[✓] HTTP Host Availability

• No issues found!

Flutter dependencies

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

Click To Expand
Dart SDK 2.17.0-266.0.dev
Flutter SDK 2.13.0-0.0.pre.406
app 1.0.0+1

dependencies:
- cupertino_icons 1.0.4
- firebase_auth 3.3.13 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta]
- firebase_core 1.14.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
- flutterfire_ui 0.4.0+1 [cloud_firestore collection crypto desktop_webview_auth email_validator firebase_auth firebase_core firebase_database firebase_dynamic_links flutter flutter_facebook_auth flutter_localizations flutter_svg google_sign_in sign_in_with_apple twitter_login]
- google_sign_in 5.2.4 [flutter google_sign_in_platform_interface google_sign_in_web]

dev dependencies:
- flutter_lints 2.0.0 [lints]
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph]

transitive dependencies:
- async 2.8.2 [collection meta]
- boolean_selector 2.1.0 [source_span string_scanner]
- characters 1.2.0
- charcode 1.3.1
- clock 1.1.0
- cloud_firestore 3.1.11 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]
- cloud_firestore_platform_interface 5.5.2 [collection firebase_core flutter meta plugin_platform_interface]
- cloud_firestore_web 2.6.11 [cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js]
- collection 1.16.0
- crypto 3.0.1 [collection typed_data]
- desktop_webview_auth 0.0.6 [crypto flutter http]
- email_validator 2.0.1
- fake_async 1.3.0 [clock collection]
- firebase_auth_platform_interface 6.2.2 [firebase_core flutter meta plugin_platform_interface]
- firebase_auth_web 3.3.11 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta]
- firebase_core_platform_interface 4.2.5 [collection flutter meta plugin_platform_interface]
- firebase_core_web 1.6.1 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_database 9.0.10 [firebase_core firebase_core_platform_interface firebase_database_platform_interface firebase_database_web flutter]
- firebase_database_platform_interface 0.2.1+2 [collection firebase_core flutter meta plugin_platform_interface]
- firebase_database_web 0.2.0+9 [firebase_core firebase_core_web firebase_database_platform_interface flutter flutter_web_plugins js]
- firebase_dynamic_links 4.1.2 [firebase_core firebase_core_platform_interface firebase_dynamic_links_platform_interface flutter meta plugin_platform_interface]
- firebase_dynamic_links_platform_interface 0.2.2+2 [firebase_core flutter meta plugin_platform_interface]
- flutter_facebook_auth 4.1.2 [flutter flutter_facebook_auth_platform_interface flutter_facebook_auth_web]
- flutter_facebook_auth_platform_interface 3.0.1 [flutter plugin_platform_interface]
- flutter_facebook_auth_web 3.0.0+1 [flutter flutter_web_plugins js flutter_facebook_auth_platform_interface]
- flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math]
- flutter_svg 1.0.3 [flutter meta path_drawing vector_math xml]
- flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math]
- google_sign_in_platform_interface 2.1.2 [flutter quiver]
- google_sign_in_web 0.10.0+5 [flutter flutter_web_plugins google_sign_in_platform_interface js]
- http 0.13.4 [async http_parser meta path]
- http_parser 4.0.0 [charcode collection source_span string_scanner typed_data]
- intl 0.17.0 [clock path]
- js 0.6.4
- lints 2.0.0
- matcher 0.12.11 [stack_trace]
- material_color_utilities 0.1.4
- meta 1.7.0
- path 1.8.1
- path_drawing 1.0.0 [vector_math meta path_parsing flutter]
- path_parsing 1.0.0 [vector_math meta]
- petitparser 5.0.0 [meta]
- plugin_platform_interface 2.1.2 [meta]
- quiver 3.0.1+1 [matcher]
- sign_in_with_apple 3.3.0 [flutter meta sign_in_with_apple_platform_interface sign_in_with_apple_web]
- 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
- source_span 1.8.2 [collection path term_glyph]
- stack_trace 1.10.0 [path]
- stream_channel 2.1.0 [async]
- string_scanner 1.1.0 [charcode source_span]
- term_glyph 1.2.0
- test_api 0.4.9 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
- twitter_login 4.1.0 [flutter crypto http]
- typed_data 1.3.0 [collection]
- vector_math 2.1.2
- xml 5.4.1 [collection meta petitparser]

@blaugold blaugold added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Apr 9, 2022
@darshankawar darshankawar added the triage Issue is currently being triaged. label Apr 11, 2022
@darshankawar
Copy link

Labeling for further insights from the team.

/cc @lesnitsky

@darshankawar darshankawar added plugin: ui platform: web Issues / PRs which are specifically for web. platform: ios Issues / PRs which are specifically for iOS. and removed Needs Attention This issue needs maintainer attention. triage Issue is currently being triaged. labels Apr 11, 2022
@lesnitsky lesnitsky self-assigned this Apr 13, 2022
@lesnitsky
Copy link
Member

lesnitsky commented Apr 28, 2022

@blaugold are you using flutterfire_cli to configure your project or GoogleServices-Info.plist?

@blaugold
Copy link
Contributor Author

Unfortunately, I need to use both because google_sign_in requires a GoogleServices-Info.plist to configure it on iOS. But I have opened a PR to support Dart-based configuration of google_sign_in on all platforms.

@lesnitsky
Copy link
Member

Would you be able to test if flutterfire_ui google sign in works with your PR on top?

@0x3dev
Copy link

0x3dev commented May 31, 2022

And it's also confusing to debug as the crash error says you should add the webClientId to CFBundleURLSchemes but then the sign in popup complaints that it can't run as web instance.

Should probably have higher priority as it can't be used on iOS without making manual changes to the plugin code.

@blaugold
Copy link
Contributor Author

Sorry about the late reply. I was hoping that the mentioned PR would be merged sooner, but it is still open. Irrespective of the PR, clientId should be nullable because even if google_sign_in eventually supports Dart-based configuration on all platforms, file-based configuration where clientId is not required could easily be made possible.

@0x3dev
Copy link

0x3dev commented May 31, 2022

Either this or it could just not be passed to the google_sign_in plugin on line 30 in google_provider file if kIsWeb.

@lesnitsky lesnitsky added this to the [UI] Stable release milestone Aug 9, 2022
@lesnitsky lesnitsky linked a pull request Aug 11, 2022 that will close this issue
10 tasks
@darshankawar darshankawar added the resolution: fixed A fix has been merged or is pending merge from a PR. label Oct 17, 2022
@firebase firebase locked and limited conversation to collaborators Nov 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: ios Issues / PRs which are specifically for iOS. platform: web Issues / PRs which are specifically for web. plugin: ui resolution: fixed A fix has been merged or is pending merge from a PR. type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants