For a client project I'm creating a simple hybrid app that serves a very simple function, yet will have high traffic. The app wouldn't normally need a backend, since it's very very simple, and firebase seems like a perfect solution for the project.
The only part where I'm stuck at is SMS Verification / Authentication with Firebase. However, after some intense googling, and doc reading, I've come to realize that there's no easy way to do this. Here's what I've looked into so far :
Usually with hybrid mobile apps, the non-native nature of them or JS APIs are to blame, but for the first time (for me at least) it feels like this isn't the case. I presume at this point Firebase isn't a valid option, but wanted to ask the loving and caring members of the community one last time before starting to look into AWS, and setting up an entire backend for the client.
Is there any other way to handle this type of authentication minus the middle-service / without a backend server? Anyone has any experience using these solutions?
UPDATE : MAY 2017
Phone Verification & Authentication is now natively available in Firebase. See my self-posted answer below.
UPDATE : APR 2017
Firebase now natively supports Cloud Functions. You can now accomplish this and a lot more using Cloud Functions without setting up any servers.
UPDATE : OCT 2017
Fabric.io and Firebase has collaborated and integrated Digits in Firebase phone authentication and launched more features for Fabric.
As of May 17 2017, the amazing people at Firebase have baked Digits' phone authentication into Firebase. This is now incredibly easy to achieve natively within Firebase, more or less with the flip of a switch and without the need of an external service or anything alike. You can read more about it in the docs :)
I can't speak to every integration you mentioned, but you might want to try out another one Twilio's services, Authy.
We've recently released production ready code samples via tutorials to help people work through these kinds of problems.
One such example walks you through:
is the 2FA with Authy tutorial. The following Node.js snippet shows the endpoint waiting for user status to be approved or denied. If the User has approved the OneTouch request, we will save their session as confirmed
, which officially logs them in.
If the request was denied we render the /verify
page and ask the User to log in with a Token.
// Internal endpoint for checking the status of OneTouch exports.authyStatus = function(request, response) { var status = (request.user) ? request.user.authyStatus : 'unverified'; if (status == 'approved') { request.session.confirmed = true; request.session.save(function(err) { if (err) return error(response, 500, 'There was an error validating your session.'); }); } if (!request.session) { return error(response, 404, 'No valid session found for this user.'); } else { response.send({ status: status }); } };
So, this indeed requires you have a server. But given a go at the sample, this should help you decide what will work best for your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With