-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Facebook login after Google login fails. #7
Comments
So allowing the user to login from multiple providers would fix this option? |
The problem happens only with Facebook -> Google. The Google login provider will always take precedence over the Facebook one, here's an example: Let's say my email address for Facebook and Google is the same: [email protected]
In this case you will have to tell the user that they can't login with Facebook anymore and they should use Google instead. |
Found a hack. Not 100% sure if this is a good idea, but it works.
|
Nice find! Tonight I will give it another shot at this issue and document my results. |
I tried the following: I had already my account with Gmail and logged in with Facebook, the login was successful and this was the response: {
"kind": "identitytoolkit#VerifyAssertionResponse",
"federatedId": "http://facebook.com/1127852910645790",
"providerId": "facebook.com",
"localId": "QcGrHghblIg4T2qLWP0RVJL8AQf2",
"emailVerified": false,
"email": "[email protected]",
"oauthAccessToken": "<Medium sized string>",
"oauthExpireIn": 5183999,
"firstName": "John",
"lastName": "Smith",
"fullName": "John Smith",
"displayName": "John Smith",
"idToken": "<Long String>",
"timeZone": "-6",
"photoUrl": "https://scontent.xx.fbcdn.net/v/t1.0-1/p100x100/418143_223575787734578_1621690654_n.jpg?oh=25b36d4a93ebcede1245e2944b188130&oe=596B6757",
"context": "",
"verifiedProvider": [
"google.com"
],
"needConfirmation": true,
"rawUserInfo": "{my Facebook profile information as sent from the Graph API}"
} The important things to notice are:
My guess is that the Swift API already knows about this and gives you this particular error. In my case I will need to manually detect if the refreshToken exists and if not, redirect the user to the Google Auth. |
Hello @reyco1 and @sfxworks
I was researching about the issue of using the same email address for Facebook and Google login, it seems it doesn't work for security reasons.
You can see in this thread an explanation about it.
I will quote the relevant part for future readers:
I will also update the examples later today to add a popup explaining the error.
The text was updated successfully, but these errors were encountered: