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

📚 Documentation: Integrating Firebase Phone Auth with Appwrite #3803

Closed
2 tasks done
afzl-wtu opened this issue Sep 9, 2022 · 9 comments
Closed
2 tasks done

📚 Documentation: Integrating Firebase Phone Auth with Appwrite #3803

afzl-wtu opened this issue Sep 9, 2022 · 9 comments
Labels
product / docs Fixes and upgrades for the Appwrite Docs.

Comments

@afzl-wtu
Copy link

afzl-wtu commented Sep 9, 2022

💭 Description

How to make it possible? I want to use firebase phone authentication. As it provides a lot of smses free in contrast to Twillo and textmagic which do not provide any free quota and seamless verification (Firebase auth flutter SDK sometime auto verify the OTP). So I can first authenticate a user with firebase SDK with flutter which is easy. But how to authenticate that user with appwrite?

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@eldadfux
Copy link
Member

As far as I can tell Firebase do not provide an API for sending SMS messages which is what required for integrating it as a messaging provider in Appwrite.

You might be better waiting for Appwrite Cloud which will provide its own free tier.
You can learn more and signup for early access here: https://appwrite.io/cloud

@afzl-wtu
Copy link
Author

As far as I can tell Firebase do not provide an API for sending SMS messages which is what required for integrating it as a messaging provider in Appwrite.

You might be better waiting for Appwrite Cloud which will provide its own free tier. You can learn more and signup for early access here: https://appwrite.io/cloud

I do not think we need firebase messaging API. Firebase SDK for flutter handles everything. When a user is successfully logged in the app firebase auth SDK tells that the user is logged in. moreover firebase auth SDK provides a JWT token for the currently logged-in user. Can we use that token or can we use any other appwrite authentication which will be based on firebase authentication? If the user is successfully logged in to firebase then login him/her on appwrite too.

@quibenefacit
Copy link

This brush-off attitude is what turns me away from Appwrite. The original requester has asked for a very useful feature for mobile apps which I would also like to see. He has clearly described it. The response he got back was a bureaucratic brush off.

If Appwrite doesn't take its users' requests seriously, users won't take Appwrite seriously either.

@eldadfux
Copy link
Member

This brush-off attitude is what turns me away from Appwrite. The original requester has asked for a very useful feature for mobile apps which I would also like to see. He has clearly described it. The response he got back was a bureaucratic brush off.

If Appwrite doesn't take its users' requests seriously, users won't take Appwrite seriously either.

We have accepted hundreds of issues and PRs from community suggestions by now. We will be more than happy to add support for Firebase or any other service vendor out there.

Adding SMS adapters for phone auth is something that was designed to work with communication providers like Twilio, Telesign or Vonage. New adapters can be easily contributing by following the contribution guide.

Adding Firebase as an OAuth adapter would also be possible if such an API was provided by Firebase, instead you could use Google's OAuth adapter.

Syncing functionality between two different auth providers is not supported in Appwrite for any provider but could be achieved by implementing such behavior on the client side or using Appwrite Functions.

From the original issues, the main motivation is getting free SMS credits, If you think there is a valid need for such sync functionality to be part of the Appwrite built-in functionality please share relevant use cases for the team to consider.

@quibenefacit
Copy link

quibenefacit commented Oct 17, 2022

@eldadfux Thanks for a more useful response.
I can't speak for the original poster's motivation, but my interest in this is indeed being able to leverage Firebase's SMS facility to receive a confirmation code. I don't understand how this is different from receiving an SMS confirmation code from Twilio, which you say you support.

@stnguyen90
Copy link
Contributor

@quibenefacit, the SMS providers we support allow us to generate codes ourselves, use the provider to send the code, and then we have the code in our database so that we can verify it. Unfortunately, Firebase does not expose any API that allows us to send an SMS message; their phone authentication is fully siloed into their platform.

Some additional resources from a quick search:

  1. https://stackoverflow.com/questions/44361815/can-i-use-firebase-for-sending-sms-to-users-without-using-twilio
  2. https://stackoverflow.com/questions/51634914/is-it-possible-to-send-a-text-message-from-firebase-to-a-phone-number
  3. https://firebase.google.com/products/extensions/twilio-send-message
  4. https://stackoverflow.com/questions/68083074/send-message-with-firebase-to-user-with-the-phone-number-they-have-provided

@quibenefacit
Copy link

quibenefacit commented Oct 17, 2022

@stnguyen90 Thank you, all of this is finally making sense.
Do you have a guide on how to implement a passwordless OTP phone auth in Appwrite using Twilio? (for iOS and Android)

@stnguyen90
Copy link
Contributor

@quibenefacit, this is a good start, but some things have changed since this was published. For example, the environment variables are now:

_APP_SMS_PROVIDER=
_APP_SMS_FROM=

Refer to our docs for the latest info:

@stnguyen90 stnguyen90 added the product / docs Fixes and upgrades for the Appwrite Docs. label Jan 11, 2023
@gewenyu99
Copy link

@stnguyen90 I'm closing this because this is no longer relevant to Appwrite + Firebase auth.

  1. This isn't possible, and it's not something we can fix. Firebase doesn't let us generate our own code in our own SDKs while using their phone auth.
  2. The discussion since shifted to using Twillio as a provider, Stn has provided instructions, our docs has since improve, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product / docs Fixes and upgrades for the Appwrite Docs.
Projects
None yet
Development

No branches or pull requests

5 participants