feat(auth): add idToken on signIn w/ Google response #633
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Type
What kind of change does this PR introduce?
PR Checklist
Please check your PR fulfills the following requirements:
Bugfixes:
New features/enhancements:
What is the purpose of this PR?
It's a common case to authenticate on native layer and propagate idToken to the web view layer. After the sign-in process completes, the user will be signed in within both tiers, and we can use web specific sdks, as AngularFire for example, to handle Firebase account.
It's widely used on Cordova/Capacitor communities, as exposed by Dayana Jabif (ionicThemes) on ionic forum
On medium: Implement Google login in Ionic 5 apps using Firebase, the author uses EddyVerbruggen/cordova-plugin-googleplus, this plugin returns idToken on signIn response
Similar approach has been shared on Simon Grimm (ionicacademy): How to use Sign In with Apple inside Ionic for Firebase Authentication, using rlfrahm/capacitor-apple-login plugin, native signInWithApple returns the idToken and is used on JS layer to signInWithCredential.
Does this PR introduce a breaking change?
What testing has been done on the changes in the PR?
I've updated own corporate project with this PR on both platforms, iOS and Android, works fine!
What testing has been done on existing functionality?
Other information
If this approach is ok, I can I fix #551 related to sign-in w/ Apple, following same logic.