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

feat(auth): add idToken on signIn w/ Google response #633

Merged
merged 1 commit into from
Jun 16, 2021

Conversation

vdias38
Copy link

@vdias38 vdias38 commented Jun 14, 2021

  • should allow to propagate the token to the web view layer and sign-in within both tiers (native and web)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Documentation changes
  • Other... Please describe:

PR Checklist

Please check your PR fulfills the following requirements:

Bugfixes:

  • Regression testing has been carried out using the example project to ensure the intended bug is fixed and no regression bugs have been inadvertently introduced.

New features/enhancements:

  • Exhaustive testing has been carried out for the new functionality
  • Regression testing has been carried out to ensure no existing functionality is adversely affected
  • Documentation has been added / updated
  • The example project has been update to validate/demonstrate the new functionality.

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

I used baumblatt/capacitor-firebase-auth to perform native login with Google, Facebook and Twitter and it works like a charm!
The plugin handles the authentication on Native layer and propagate the token to the web view layer. After the sign-in process completes, the user will be signed in within both tiers.

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?

  • Yes
  • No

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.

- should allow to propagate the token to the web view layer and sign-in within both tiers (native and web)
@TheNotorius0
Copy link

@vdias38, your merge was perfect, and I use your implementation on my app. Since most of us (I guess) publish apps on both the Apple Store and the Play Store, having the same feature for sign-in w/ Apple would be wonderful (and as you said already, it would fix this issue #551)

@vdias38
Copy link
Author

vdias38 commented Jan 16, 2024

Hi @TheNotorius0, I don't think it's big deal to add it for iOS. But at the moment I've no time to implement it. I'm surprised nobody added it yet. I'll track it and if I can find a day free on next weeks I'll try to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to provide identity token instead of credential in authenticateUserWithApple
3 participants