baumblatt / capacitor-firebase-auth

Capacitor Firebase Authentication Plugin
MIT License
261 stars 129 forks source link

Support for web platform #80

Open benedictjohannes opened 4 years ago

benedictjohannes commented 4 years ago

I'm just beginning to use this project (next branch) and I've used the Google sign in method on Android quite successfully.

This project does help immensely in implementing native login method. However, this project currently has no support for capacitor's web platform. To make it work with what I'm building (need to be available as simple PWA in addition to hybrid app), I use switchable login method based on the current platform reported by capacitor.

Is there any plan for the plugin to to support web platform?

This might not be a 1-1 mapping, as for instance, Google's web login flow allows redirect and pop up method. The plugin might offer customization options or defaults to documented opinionated choice.

benedictjohannes commented 4 years ago

I was just aware that this might be a close duplicate to #27

Allow me to add up my suggestion on this issue.

If web's various sign in methods is a major hurdle, overload SignInOptions in method calls with parameters to switch which web sign in methods that gets mapped to cfa${providerId}SignIn(data?: SignInOptions) and also cfaSignIn(providerId:string, data?: SignInOptions). SignInOptions would then accept an additional key, like webSignInMethod: 'redirect' || 'popup'.

ASomerN commented 4 years ago

Would love to see this implemented for web too!

baumblatt commented 4 years ago

Hello @benedictjohannes, @ASomerN ,

Please take a look at version 2.2.1, there is support for Google, Twitter and Facebook for Web Platform.

Please, let keep this issue open to track the work for Phone authentication.

If you like this plugin, please don't forget to put a star on the project to help others to find it.

Please, let me know if you need more information or we can close this issue.

Best regards, Bernardo Baumblatt

nelson6e65 commented 4 years ago

OMG 😮

Amazing! Thank you very much!

renearias commented 4 years ago

thanks for the update Congratulations!

ASomerN commented 4 years ago

It would be really handy to see a working sample, I'm trying to integrate firebase-ui into a capacitor project and hitting no end of issues. ideally, I would have this as well as firebase-ui, would it be possible?

baumblatt commented 4 years ago

Hello @ASomerN ,

I don't think this will gonna work. The firebase-ui handle the authentication interacting direct with firebase library.

The web implementation of this plugin handle calls from Capacitor framework redirecting to firebase library.

Take a look how simple is the googleSignInWeb implementation here!

But please, if you have an ideia of how we can put this to work, let me know.

Best regards,
Bernardo Baumblatt

ASomerN commented 4 years ago

Thanks. I'll give this a go.

On Tue, 29 Sep 2020, 23:10 Bernardo Baumblatt, notifications@github.com wrote:

Hello @ASomerN https://github.com/ASomerN ,

I don't think this will gonna work. The firebase-ui handle the authentication interacting direct with firebase library.

The web implementation of this plugin handle calls from Capacitor framework redirecting to firebase library.

Take a look how simple is the googleSignInWeb implementation here https://github.com/baumblatt/capacitor-firebase-auth/blob/00f108313d4dbad36a0f3203a77ba90f9c2f1574/src/providers/google.provider.ts#L6 !

But please, if you have an ideia of how we can put this to work, let me know.

Best regards, Bernardo Baumblatt

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/baumblatt/capacitor-firebase-auth/issues/80#issuecomment-701019153, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG6L5EWQA666NWLVBVZ7YXDSIJLOTANCNFSM4NIBNCMQ .

ASomerN commented 4 years ago

I've attempted to integrate this with an app, however, there are immediate breaking changes on installing the package. I'm going to need to try and set up some basic boilerplate code and share it because I can't see from the instructions how I'm integrating this into an app.

After fixing the many peer dependency errors I had on install, the methods on the import are not available, and the subscribe in this function:

cfaSignIn('google.com').subscribe( (user: User) => console.log(user.displayName); ) throws an error regarding subscription.

I am absolutely certain I am implementing this incorrectly, but having issues have I have no frame of reference.

If anyone has a sample that can be shared showing how this is implemented it would be immensely helpful.