Create customized Auth on Firebase for SIWA (Sign up with Apple) customers after switch of iOS app to totally different App Retailer Join crew

0
10
Create customized Auth on Firebase for SIWA (Sign up with Apple) customers after switch of iOS app to totally different App Retailer Join crew


Apparently, I must create a customized Auth for Firebase — on account of not with the ability to straight modify providerData (also called provider_data) that is a part of the Person Document. Any strategies or steering is appreciated.

Our iOS app makes use of Sign up with Apple, and that labored positive with Firebase’s built-in performance… till we wanted to switch the app to a unique crew in App Retailer Join. It seems that the ID and personal relay e mail deal with that Apple offers for every consumer is exclusive to the App Retailer Join crew, not merely distinctive to the app. The result’s that when attempting to log in with SIWA beneath the brand new crew, Firebase’s regular auth is unable to find the consumer’s account — as a result of the ID from Apple is totally different beneath the brand new crew, and the e-mail deal with will even be totally different if the consumer chosen the personal relay e mail deal with choice.

Firebase shops the sub (the ID offered by Apple) because the uid which is a part of the providerData on the Person Document, however my understanding is that we can’t modify the providerData straight, and so we’ll must create a very customized Auth setup on the Firebase aspect as a way to enable SIWA customers to proceed to log in after our app is transferred to the brand new App Retailer Join crew.

Has anybody gone by way of this course of earlier than? If that’s the case, any suggestions or strategies for how one can setup the customized Auth in Firebase?

I perceive the method from the Apple aspect fairly properly now… as we’re making ready to switch the app from Workforce A to Workforce B, for every consumer we’ll name Apple’s endpoint /auth/usermigrationinfo as Workforce A to retrieve the transfer_sub (also called the “switch identification”) which we then will to retailer someplace in Firebase. Then as Workforce B, we’ll name Apple’s endpoint /auth/usermigrationinfo as a way to retrieve the consumer’s new sub and their probably new e mail deal with… and we’ll once more need to retailer that in Firebase.

The tough half appears to be how one can create the customized Auth performance for Firebase.

LEAVE A REPLY

Please enter your comment!
Please enter your name here