Search code examples
firebasefirebase-authenticationtwitter-digitsgoogle-fabricfabric-digits

How to migrate twitter-digits web SDK to Firebase?


We are using Digits Web SDK for our WordPress website.

Once we get the mobile confirmation from digits we are sending X-oAuth echo headers to our own auth server, which then does the next processing and returns our custom JWT.

Recently we got the news that Digits will retire on 30th September 2017.

We have gone through the migration instruction, but did not understand how it keeps our flow same as earlier?

Isn't Firebase providing JS SDK instead of this Digits SDK?

How will we send the X-oAuth echo headers or any other user information to our server once user is authenticated using Firebase?

Any help will be appreciated.


Solution

  • Unfortunately, there is no easy one-click migration from Digits to Firebase and you need to develop new way of token verification.

    Twitter Digits used OAuth Echo headers, but Firebase does not provide it. Instead, Firebase provides ID Tokens (JWT tokens)

    This is how verify it on the backend side https://firebase.google.com/docs/auth/admin/verify-id-tokens

    Unfortunately, they do not have Ruby Admin SDK, so I wrote my own implementation of ID tokens verification in Ruby, maybe someone will find it useful https://medium.com/@igorkhomenko/how-to-validate-firebase-id-token-in-ruby-23f4f54c89ab