capacitor-firebase-auth icon indicating copy to clipboard operation
capacitor-firebase-auth copied to clipboard

Support for web platform

Open benedictjohannes opened this issue 4 years ago • 9 comments

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 avatar May 22 '20 18:05 benedictjohannes

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'.

benedictjohannes avatar May 22 '20 18:05 benedictjohannes

Would love to see this implemented for web too!

ASomerN avatar Jun 25 '20 07:06 ASomerN

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

baumblatt avatar Jul 04 '20 01:07 baumblatt

OMG 😮

Amazing! Thank you very much!

nelson6e65 avatar Jul 04 '20 02:07 nelson6e65

thanks for the update Congratulations!

renearias avatar Sep 29 '20 17:09 renearias

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?

ASomerN avatar Sep 29 '20 21:09 ASomerN

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

baumblatt avatar Sep 29 '20 22:09 baumblatt

Thanks. I'll give this a go.

On Tue, 29 Sep 2020, 23:10 Bernardo Baumblatt, [email protected] 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 avatar Sep 29 '20 22:09 ASomerN

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.

ASomerN avatar Oct 10 '20 15:10 ASomerN