PhantomAppDevelopment/firebase-as3

refreshToken not returning for Facebook

Closed this issue · 5 comments

@agentphantom I tried this example and I do get the refreshToken for signing in with Google but not for Facebook

screen shot 2016-12-14 at 8 52 19 am

I will take another look, I tested it on Facebook and it worked fine for me.

I just tested FederatedLogin.mxml example with the 3 providers and I got the refreshToken from all of them.

I used the same APi Key and project id from my Pizza App production version which has enabled and configured the 3 providers.

I got it to work... The problem is that if you are a brand new user and you use any login method other than Facebook to login, you get the refreshToken but when you try and login with Facebook after that, you do not get it... If the user will be using multiple login methods and wants Facebook to work, he has to use Facebook first to login. Then he will get the refreshToken for all methods, including Facebook.... Weird behavior, man. But I guess that's how Firebase is set up :-/

I found something similar a time ago.

Let's say my email is the same on Facebook and Google. If I login (and register) on a Firebase project with Facebook it will work fine every time I login with Facebook, but if I try to login using Google it won't let me.

This escenario is unlikely to happen to most users but I think the only solution is to link accounts, but I hadn't studied that API call well enough because detecting this issue is very hard.

I will take a further look of what you mentioned, maybe there's something that can be done to work around it.

I did a more comprehensive testing:

I used the Pizza App project on Firebase and deleted my account.

Then I signed up fresh with Twitter and received the refreshToken at the first try, then I signed out and deleted my account again from the Firebase console.

I repeated the same for all 3 providers on OSX and Android and in all 6 instances I received the refreshToken from the first sign in.

I used the latest version of Pizza App that I committed yesterday.