flutterfire
flutterfire copied to clipboard
feat(firebase_auth): add custom auth domain setter to Firebase Auth
Description
https://github.com/firebase/flutterfire/pull/11925 allowed, previously web exclusive, authDomain property to be used on mobile platform; however, actually using it has significant limitations:
- It requires creating a separate named FirebaseApp with authDomain property on top of the
[DEFAULT]FirebaseAppgenerated fromGoogleService-Info.plist/google-services.jsonbecause there's no way to set authDomain via those files. - 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 https://github.com/firebase/flutterfire/pull/11925
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.
- [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
- [x] My PR includes unit or integration tests for all changed/updated/fixed behaviors (See [Contributor Guide]).
- [x] All existing and new tests are passing.
- [x] I updated/added relevant documentation (doc comments with
///). - [x] The analyzer (
melos run analyze) does not report any problems on my PR. - [x] I read and followed the [Flutter Style Guide].
- [x] I signed the [CLA].
- [x] 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.
- [x] No, this is not a breaking change.
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.
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 👍
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.
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?