Skip to content

🐛 [firebase_auth] authDomain value is not used when calling auth.signInWithProvider #9668

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

Closed
sidlatau opened this issue Oct 4, 2022 · 9 comments · Fixed by #11925
Closed
Assignees
Labels
blocked: firebase-sdk plugin: auth resolution: fixed A fix has been merged or is pending merge from a PR. type: enhancement New feature or request

Comments

@sidlatau
Copy link

sidlatau commented Oct 4, 2022

Bug report

When using OAuthProvider method auth.signInWithProvider(microsoftProvider); it is not possible to change redirect_uri parameter even when authDomain in firebase options is set. Default redirect uri https://[app].firebaseapp.com/__/auth/handler
is always used.

Steps to reproduce

  final app = await Firebase.initializeApp(
        options: FirebaseOptions(
            apiKey: '...',
            appId: '...',
            authDomain: 'app.client1.com',
            messagingSenderId: '..',
            projectId: '..',
            storageBucket: '....appspot.com',
          ),
      );

  print(app.options.authDomain); // Prints "null"

  final auth = FirebaseAuth.instanceFor( app: app);
  final microsoftProvider = MicrosoftAuthProvider();

   await auth.signInWithProvider(microsoftProvider); 

   // Expected redirect uri: https://app.client1.com/__/auth/handler
   // Actual: https://[app].firebaseapp.com/__/auth/handler

Expected behavior

When authDomain is provided in firebase options, it should be used in redirect uri when calling signInWithProvider

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 stable, 3.3.3, on macOS 12.6 21G115 darwin-arm, locale en-LT)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.71.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

Flutter dependencies

Click To Expand
Dart SDK 2.18.2
Flutter SDK 3.3.3
site 2.9.0+455

dependencies:
- cached_network_image 3.2.2 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web]
- cloud_firestore 3.5.0 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter met
a]
- cloud_functions 3.3.9 [cloud_functions_platform_interface cloud_functions_web firebase_core firebase_core_platform_interface flutter]
- collection 1.16.0
- connectivity_plus 2.3.7 [flutter connectivity_plus_platform_interface connectivity_plus_linux connectivity_plus_macos connectivity_plus_web connect
ivity_plus_windows]
- cupertino_icons 1.0.5
- dio 4.0.6 [http_parser path]
- firebase_analytics 9.3.7 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter]
- firebase_auth 3.11.1 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta]
- firebase_core 1.23.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_storage 10.3.10 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
- flutter_barcode_scanner 2.0.0 [flutter flutter_plugin_android_lifecycle]
- flutter_cache_manager 3.3.0 [clock collection file flutter http path path_provider pedantic rxdart sqflite uuid]
- flutter_email_sender 5.1.0 [flutter]
- flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math]
- flutter_riverpod 1.0.4 [collection flutter meta riverpod state_notifier]
- flutter_svg 1.1.5 [flutter meta path_drawing vector_math xml]
- freezed_annotation 2.1.0 [collection json_annotation meta]
- geolocator 9.0.2 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web geolocator_windows]
- gesture_x_detector 1.1.1 [flutter vector_math]
- google_maps_flutter 2.2.1 [flutter google_maps_flutter_android google_maps_flutter_ios google_maps_flutter_platform_interface]
- image_picker 0.8.5+3 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_platform_interface]
- intl 0.17.0 [clock path]
- json_annotation 4.7.0 [meta]
- meta 1.8.0
- mime 1.0.2
- open_file 3.2.1 [flutter ffi]
- package_info_plus 1.4.2 [flutter package_info_plus_platform_interface package_info_plus_linux package_info_plus_macos package_info_plus_windows pac
kage_info_plus_web]
- path 1.8.2
- path_provider 2.0.11 [flutter path_provider_android path_provider_ios path_provider_linux path_provider_macos path_provider_platform_interface path
_provider_windows]
- permission_handler 10.0.2 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_
interface]
- photo_view 0.14.0 [flutter gesture_x_detector]
- quiver 3.1.0 [matcher]
- retry 3.1.0
- sembast 3.3.0 [meta path synchronized]
- sentry_dio 6.11.2 [dio sentry]
- sentry_flutter 6.11.2 [flutter flutter_web_plugins sentry package_info_plus meta]
- shared_preferences 2.0.15 [flutter shared_preferences_android shared_preferences_ios shared_preferences_linux shared_preferences_macos shared_prefe
rences_platform_interface shared_preferences_web shared_preferences_windows]
- tuple 2.0.0 [quiver]
- url_launcher 6.1.6 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launche
r_web url_launcher_windows]
- uuid 3.0.6 [crypto]

dev dependencies:
- build_runner 2.2.1 [args async analyzer 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_socke
t stack_trace stream_transform timing watcher web_socket_channel yaml]
- fake_cloud_firestore 1.3.1 [flutter cloud_firestore cloud_firestore_platform_interface collection plugin_platform_interface quiver rxdart]
- file 6.1.2 [meta path]
- firebase_auth_mocks 0.8.6 [flutter firebase_auth meta equatable dart_jsonwebtoken uuid]
- flutter_launcher_icons 0.10.0 [args checked_yaml cli_util image json_annotation path yaml]
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters collection matcher material_co
lor_utilities meta source_span stream_channel string_scanner term_glyph]
- freezed 2.1.0+1 [analyzer build build_config collection meta source_gen freezed_annotation json_annotation]
- integration_test 0.0.0 [flutter flutter_driver flutter_test path vm_service archive async boolean_selector characters clock collection crypto fake_
async file matcher material_color_utilities meta source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vecto
r_math webdriver]
- json_serializable 6.4.1 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper]
- mocktail 0.3.0 [collection matcher test]

transitive dependencies:
- _fe_analyzer_shared 47.0.0 [meta]
- _flutterfire_internals 1.0.1 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flut
ter meta]
- analyzer 4.7.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- archive 3.3.0 [crypto path]
- args 2.3.1
- async 2.9.0 [collection meta]
- boolean_selector 2.1.0 [source_span string_scanner]
- build 2.3.0 [analyzer async convert crypto glob logging meta path]
- build_config 1.1.0 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 3.1.0 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_cha
nnel]
- build_resolvers 2.0.9 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml]
- build_runner_core 7.2.3 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_c
onfig pool timing watcher yaml]
- built_collection 5.1.1
- built_value 8.4.1 [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]
- characters 1.2.1
- checked_yaml 2.0.1 [json_annotation source_span yaml]
- cli_util 0.3.5 [meta path]
- clock 1.1.1
- cloud_firestore_platform_interface 5.7.6 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- cloud_firestore_web 2.8.9 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web
_plugins js]
- cloud_functions_platform_interface 5.1.18 [firebase_core flutter meta plugin_platform_interface]
- cloud_functions_web 4.3.7 [cloud_functions_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js]
- code_builder 4.2.0 [built_collection built_value collection matcher meta]
- connectivity_plus_linux 1.3.1 [flutter connectivity_plus_platform_interface meta nm]
- connectivity_plus_macos 1.2.4 [connectivity_plus_platform_interface flutter]
- connectivity_plus_platform_interface 1.2.1 [flutter meta plugin_platform_interface]
- connectivity_plus_web 1.2.3 [connectivity_plus_platform_interface flutter_web_plugins flutter]
- connectivity_plus_windows 1.2.2 [connectivity_plus_platform_interface flutter]
- convert 3.0.2 [typed_data]
- coverage 1.5.0 [args logging package_config path source_maps stack_trace vm_service]
- cross_file 0.3.3+1 [js meta]
- crypto 3.0.2 [typed_data]
- dart_jsonwebtoken 2.4.2 [crypto pointycastle convert collection]
- dart_style 2.2.3 [analyzer args path pub_semver source_span]
- dbus 0.7.4 [args ffi meta xml]
- equatable 2.0.5 [collection meta]
- fake_async 1.3.1 [clock collection]
- ffi 1.2.1
- firebase_analytics_platform_interface 3.3.6 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_analytics_web 0.4.2+6 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_pl
ugins js]
- firebase_auth_platform_interface 6.10.0 [collection firebase_core flutter meta plugin_platform_interface]
- firebase_auth_web 4.6.0 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta]
- firebase_core_platform_interface 4.5.1 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 1.7.3 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_storage_platform_interface 4.1.18 [collection firebase_core flutter meta plugin_platform_interface]
- firebase_storage_web 3.3.8 [_flutterfire_internals async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_pl
ugins http js meta]
- fixnum 1.0.1
- flutter_blurhash 0.7.0 [flutter]
- flutter_driver 0.0.0 [file flutter flutter_test fuchsia_remote_debug_protocol path meta vm_service webdriver archive async boolean_selector charact
ers clock collection crypto matcher material_color_utilities platform process source_span stack_trace stream_channel string_scanner sync_http term_gl
yph test_api typed_data vector_math]
- flutter_plugin_android_lifecycle 2.0.7 [flutter]
- flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math]
- frontend_server_client 2.1.3 [async path]
- fuchsia_remote_debug_protocol 0.0.0 [process vm_service file meta path platform]
- geolocator_android 4.1.3 [flutter geolocator_platform_interface]
- geolocator_apple 2.2.1 [flutter geolocator_platform_interface]
- geolocator_platform_interface 4.0.6 [flutter plugin_platform_interface vector_math meta]
- geolocator_web 2.1.6 [flutter flutter_web_plugins geolocator_platform_interface]
- geolocator_windows 0.1.1 [flutter geolocator_platform_interface]
- glob 2.1.0 [async collection file path string_scanner]
- google_maps_flutter_android 2.3.0 [flutter flutter_plugin_android_lifecycle google_maps_flutter_platform_interface stream_transform]
- google_maps_flutter_ios 2.1.11 [flutter google_maps_flutter_platform_interface stream_transform]
- google_maps_flutter_platform_interface 2.2.2 [collection flutter plugin_platform_interface stream_transform]
- graphs 2.1.0 [collection]
- http 0.13.5 [async http_parser meta path]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.1 [collection source_span string_scanner typed_data]
- image 3.2.0 [archive meta xml]
- image_picker_android 0.8.5+3 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface]
- image_picker_for_web 2.1.8 [flutter flutter_web_plugins image_picker_platform_interface]
- image_picker_ios 0.8.6 [flutter image_picker_platform_interface]
- image_picker_platform_interface 2.6.1 [cross_file flutter http plugin_platform_interface]
- io 1.0.3 [meta path string_scanner]
- js 0.6.4
- logging 1.0.2
- matcher 0.12.12 [stack_trace]
- material_color_utilities 0.1.5
- nm 0.5.0 [dbus]
- node_preamble 2.0.1
- octo_image 1.0.2 [flutter flutter_blurhash]
- package_config 2.1.0 [path]
- package_info_plus_linux 1.0.5 [package_info_plus_platform_interface flutter path]
- package_info_plus_macos 1.3.0 [flutter]
- package_info_plus_platform_interface 1.0.2 [flutter meta plugin_platform_interface]
- package_info_plus_web 1.0.5 [flutter flutter_web_plugins http meta package_info_plus_platform_interface]
- package_info_plus_windows 1.0.5 [package_info_plus_platform_interface ffi flutter win32]
- path_drawing 1.0.1 [vector_math meta path_parsing flutter]
- path_parsing 1.0.1 [vector_math meta]
- path_provider_android 2.0.20 [flutter path_provider_platform_interface]
- path_provider_ios 2.0.11 [flutter path_provider_platform_interface]
- path_provider_linux 2.1.7 [ffi flutter path path_provider_platform_interface xdg_directories]
- path_provider_macos 2.0.6 [flutter path_provider_platform_interface]
- path_provider_platform_interface 2.0.4 [flutter platform plugin_platform_interface]
- path_provider_windows 2.0.7 [ffi flutter path path_provider_platform_interface win32]
- pedantic 1.11.1
- permission_handler_android 10.0.0 [flutter permission_handler_platform_interface]
- permission_handler_apple 9.0.4 [flutter permission_handler_platform_interface]
- permission_handler_platform_interface 3.7.0 [flutter meta plugin_platform_interface]
- permission_handler_windows 0.1.0 [flutter permission_handler_platform_interface]
- petitparser 5.0.0 [meta]
- platform 3.1.0
- plugin_platform_interface 2.1.2 [meta]
- pointycastle 3.6.2 [collection convert js]
- pool 1.5.1 [async stack_trace]
- process 4.2.4 [file path platform]
- pub_semver 2.1.1 [collection meta]
- pubspec_parse 1.2.1 [checked_yaml collection json_annotation pub_semver yaml]
- riverpod 1.0.3 [collection meta state_notifier]
- rxdart 0.27.5
- sentry 6.11.2 [http meta stack_trace uuid intl]
- shared_preferences_android 2.0.13 [flutter shared_preferences_platform_interface]
- shared_preferences_ios 2.1.1 [flutter shared_preferences_platform_interface]
- shared_preferences_linux 2.1.1 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface]
- shared_preferences_macos 2.0.4 [flutter shared_preferences_platform_interface]
- shared_preferences_platform_interface 2.1.0 [flutter plugin_platform_interface]
- shared_preferences_web 2.0.4 [flutter flutter_web_plugins shared_preferences_platform_interface]
- shared_preferences_windows 2.1.1 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface]
- shelf 1.3.2 [async collection http_parser path stack_trace stream_channel]
- shelf_packages_handler 3.0.1 [path shelf shelf_static]
- shelf_static 1.1.1 [convert http_parser mime path shelf]
- shelf_web_socket 1.0.2 [shelf stream_channel web_socket_channel]
- sky_engine 0.0.99
- source_gen 1.2.2 [analyzer async build dart_style glob meta path source_span yaml]
- source_helper 1.3.2 [analyzer collection source_gen]
- source_map_stack_trace 2.1.0 [path stack_trace source_maps]
- source_maps 0.10.10 [source_span]
- source_span 1.9.0 [collection path term_glyph]
- sqflite 2.0.3+1 [flutter sqflite_common path]
- sqflite_common 2.2.1+1 [synchronized path meta]
- stack_trace 1.10.0 [path]
- state_notifier 0.7.2+1 [meta]
- stream_channel 2.1.0 [async]
- stream_transform 2.0.0
- string_scanner 1.1.1 [source_span]
- sync_http 0.3.1
- synchronized 3.0.0+3
- term_glyph 1.2.1
- test 1.21.4 [analyzer async boolean_selector collection coverage http_multi_server io js node_preamble package_config path pool shelf shelf_package
s_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]
- test_api 0.4.12 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
- test_core 0.4.16 [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 matcher test_api]
- timing 1.0.0 [json_annotation]
- typed_data 1.3.1 [collection]
- url_launcher_android 6.0.18 [flutter url_launcher_platform_interface]
- url_launcher_ios 6.0.17 [flutter url_launcher_platform_interface]
- url_launcher_linux 3.0.1 [flutter url_launcher_platform_interface]
- url_launcher_macos 3.0.1 [flutter url_launcher_platform_interface]
- url_launcher_platform_interface 2.1.0 [flutter plugin_platform_interface]
- url_launcher_web 2.0.13 [flutter flutter_web_plugins url_launcher_platform_interface]
- url_launcher_windows 3.0.1 [flutter url_launcher_platform_interface]
- vector_math 2.1.2
- vm_service 9.0.0
- watcher 1.0.1 [async path]
- web_socket_channel 2.2.0 [async crypto stream_channel]
- webdriver 3.0.0 [archive matcher path stack_trace sync_http]
- webkit_inspection_protocol 1.2.0 [logging]
- win32 2.6.1 [ffi]
- xdg_directories 0.2.0+2 [meta path process]
- xml 6.1.0 [collection meta petitparser]
- yaml 3.1.1 [collection source_span string_scanner]

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

Thanks for the report. Using code sample provided, I see the same behaviour.

@darshankawar darshankawar added plugin: auth and removed Needs Attention This issue needs maintainer attention. triage Issue is currently being triaged. labels Oct 4, 2022
@darshankawar
Copy link

/cc @Lyokone

@Lyokone Lyokone self-assigned this Oct 6, 2022
@Lyokone
Copy link
Contributor

Lyokone commented Oct 25, 2022

Hello :)
I've checked your issue, and AuthDomain is only supported on web. Can you confirm that it's working properly on web?
We can open a ticket in Android / iOS to get AuthDomain support in the main SDK if needed.

@Lyokone Lyokone added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Oct 25, 2022
@sidlatau
Copy link
Author

Yes, we are using AuthDomain property on web and it is working properly. In my opinion it should work the same in Android and iOS too.

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Oct 27, 2022
@darshankawar darshankawar removed the Needs Attention This issue needs maintainer attention. label Oct 31, 2022
@eli1stark
Copy link

@darshankawar @Lyokone Hi, is there any timeline for adding support for authDomain on Android and iOS, can we please open a ticket to get support if it's not opened yet?

@JonasTriki
Copy link

Any updates on this?

@CephasPeter
Copy link

Any updates on this? @darshankawar @Lyokone

@russellwheatley russellwheatley added type: bug Something isn't working type: enhancement New feature or request and removed type: bug Something isn't working labels Oct 12, 2023
@russellwheatley
Copy link
Member

russellwheatley commented Oct 13, 2023

Support for custom auth domain has been released in the latest Firebase iOS SDK 10.16.0: https://firebase.google.com/support/release-notes/ios#authentication

We have an open PR for bumping Firebase iOS SDK to 10.16.0 here: #11698

Here is the open ticket for Firebase android SDK here that you may wish to thumb up to give it a higher priority: firebase/firebase-android-sdk#4805

@davidmigloz
Copy link

davidmigloz commented Nov 20, 2023

It seems it is now available in Android as well:

@darshankawar darshankawar added the resolution: fixed A fix has been merged or is pending merge from a PR. label Nov 27, 2023
@firebase firebase locked and limited conversation to collaborators Dec 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked: firebase-sdk plugin: auth resolution: fixed A fix has been merged or is pending merge from a PR. type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants