PhantomAppDevelopment / firebase-as3

Integrate Firebase Auth, Realtime Database and Storage in your Adobe AIR projects.
MIT License
55 stars 12 forks source link

Firebase Phone Auth #15

Open benkhachouch opened 7 years ago

benkhachouch commented 7 years ago

Thanks you for your good job!

Do you know Firebase Phone Auth

if yes, Do you plan to add it?

agentphantom commented 7 years ago

Hi,

I just read about it. There's one thing that might be a problem, the recaptcha process.

A workaround would be to host the html and JavaScript in Firebase Hosting and load it using StageWebView.

If there's a pure REST API I will try to add it.

benkhachouch commented 7 years ago

good new. recaptcha can be invisible. Here the demo

https://fir-ui-demo-84a6c.firebaseapp.com/

Le 28 mai 2017 21:43, "Mr. Phantom" notifications@github.com a écrit :

Hi,

I just read about it. There's one thing that might be a problem, the recaptcha process.

A workaround would be to host the html and JavaScript in Firebase Hosting and load it using StageWebView.

If there's a pure REST API I will try to add it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PhantomAppDevelopment/firebase-as3/issues/15#issuecomment-304535741, or mute the thread https://github.com/notifications/unsubscribe-auth/AMYpy7WpOqTHgPstg7Wzyd-wAFcANzeMks5r-c5mgaJpZM4NnZH4 .

agentphantom commented 7 years ago

Thanks!

In the last hours I have been studying how it works and I almost got it working.

I will explain what I got and what failed:

When you start a Phone Auth, Firebase connects to the Google Identity Toolkit and retrieves a recaptchaToken and a recaptchaSiteKey.

Then Firebase exchanges those with the Google Recaptcha Server for another recaptchaToken. This is where I failed, I wasn't able to find a way to get this new token.

Then you need to send to Google Identity Toolkit the new recaptchaToken and the Phone Number with the country code. You will receive a session id.

Finally you send to another Google Identity Toolkit the verification code and the session id from the previous request and the user gets registered.