Skip to content

feat(firebase_auth): add custom auth domain setter to Firebase Auth #12218

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

Merged
merged 14 commits into from
Mar 26, 2024
Merged

feat(firebase_auth): add custom auth domain setter to Firebase Auth #12218

merged 14 commits into from
Mar 26, 2024

Conversation

Andrey-K-Calven
Copy link
Contributor

@Andrey-K-Calven Andrey-K-Calven commented Jan 30, 2024

Description

#11925 allowed, previously web exclusive, authDomain property to be used on mobile platform; however, actually using it has significant limitations:

  1. It requires creating a separate named FirebaseApp with authDomain property on top of the [DEFAULT] FirebaseApp generated from GoogleService-Info.plist/google-services.json because there's no way to set authDomain via those files.
  2. Changing authDomain requires deleting and recreating the FirebaseApp.

This change addresses those by adding a custom auth domain setter to FirebaseAuth, plugging into the existing corresponding setters in the native implementations of FirebaseAuth. With this setter authDomain can be set and reset at will on the [DEFAULT] FirebaseApp's FirebaseAuth. This allows for custom auth domains to be used with the go-to style of FirebaseApp initialisation on mobile platforms and is consistent with the way this is handled in the native implementations.

Related Issues

expands on #11925
closes #12517

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
This will ensure a smooth and quick review process. Updating the pubspec.yaml and changelogs is not required.

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See [Contributor Guide]).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (melos run analyze) does not report any problems on my PR.
  • I read and followed the [Flutter Style Guide].
  • I signed the [CLA].
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

Copy link

google-cla bot commented Jan 30, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@russellwheatley
Copy link
Member

Hey @Andrey-K-Calven - thanks for the PR! We're discussing internally on how to move this forward, will let you know what results from the discussions 👍

@Andrey-K-Calven
Copy link
Contributor Author

Hey @Andrey-K-Calven - thanks for the PR! We're discussing internally on how to move this forward, will let you know what results from the discussions 👍

Hi, @russellwheatley. Thanks for looking at this, did you have a chance to have that discussion? We'd like to use this approach for our auth domain needs.

@Lyokone
Copy link
Contributor

Lyokone commented Mar 20, 2024

Hey @Andrey-K-Calven, we finally had the green light for this API. Do you mind merging with master to be sure that tests are passing with all the latest changes?

Comment on lines 2755 to 2762
const PigeonActionCodeSettings* action_code_settings_arg =
nullptr;
if (!encodable_action_code_settings_arg.IsNull()) {
action_code_settings_arg =
&(std::any_cast<const PigeonActionCodeSettings&>(
std::get<CustomEncodableValue>(
encodable_action_code_settings_arg)));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be put back, not related to the modifications

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another manual update. We should probably make a script for these.

@russellwheatley russellwheatley requested a review from Lyokone March 26, 2024 11:48
@russellwheatley russellwheatley merged commit e129780 into firebase:master Mar 26, 2024
@Andrey-K-Calven Andrey-K-Calven deleted the feat/add-custom-auth-domain-setter-to-fbauth branch March 26, 2024 22:09
LocLt-Mobile pushed a commit to guide-inc-org/guide-flutter_fire that referenced this pull request Apr 5, 2024
LocLt-Mobile pushed a commit to guide-inc-org/guide-flutter_fire that referenced this pull request Apr 5, 2024
LocLt-Mobile pushed a commit to guide-inc-org/guide-flutter_fire that referenced this pull request Apr 5, 2024
LocLt-Mobile pushed a commit to guide-inc-org/guide-flutter_fire that referenced this pull request Apr 5, 2024
LocLt-Mobile pushed a commit to guide-inc-org/guide-flutter_fire that referenced this pull request Apr 16, 2024
LocLt-Mobile pushed a commit to guide-inc-org/guide-flutter_fire that referenced this pull request Apr 16, 2024
@firebase firebase locked and limited conversation to collaborators Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[firebase_auth]: authDomain not working on mobile despite announced support
4 participants