[AC-1746] Error: 'Email is already taken' on ACS Facebook login
GitHub Issue | n/a |
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2014-01-05T23:39:37.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Alloy, Titanium SDK & CLI |
Labels | n/a |
Reporter | Daniel Mahon |
Assignee | Shak Hossain |
Created | 2013-01-25T18:28:28.000+0000 |
Updated | 2016-03-08T07:40:38.000+0000 |
Description
Steps to Reproduce
Log in user with external account to ACS. This doesnt seem to happen with every user. I have tried with 2 accounts, my personal account logs in, creates new ACS user fine, logs out. The other is inconsistent. It will login and create a user the first time but it will not allow me to update that ACS user. Logout is fine but on the next external login I will get the error: Email is already taken.
Actual Result
Error: Email is already taken.
Expected Result
Success
Comments
JSON Source
Please provide a code sample of what you are doing and I will research.
Code Sample: https://gist.github.com/4667734 Notes: If I remove the email from the update call it works, the account logs in and updates correctly but if I make a call to ACS after the login, the user record doesnt seem to exist. I see and can query only 2 of 3 created accounts. I have now tested on 3 facebook accounts 2 of which work 1 still does not. It is acting almost as if there is a corrupt record in ACS for that specific user.
Please reopen as I have provided the code sample. Also, I notice that the user I try to login is prompted with the "Save this device" dialog through facebook on EVERY login. I also noticed that the ACS USER ID is different upon sequential logins. It is still acting as if the initial login is NEVER getting persisted to ACS and therefore generating new ids on each attempt, however it still gives the "Email is already taken" error. I am at the end of the rope on this one. I was hoping to use ACS for my user profiles and migrate away from my own DB. I just need to know if its something I'm doing on my end or a problem with ACS. If it has to do with some facebook settings that is a deal breaker as well because I cant assume to know my users FB settings. I would appreciate ANY direction you could give. Thanks!
When you use Social Intergration to login to Facebook, it auto creates an account in ACS with the Facebook email and the users first and last name from facebook. It gives that user a unique ID, and then you are logged in. There is no need to try and update the user with the Facebook details. I believe this is why you are getting the error that the email is already taken. Have you looked in your ACS control panel for the app to see if the user exists with the proper email?
The ACS control panel (and API calls) never show that user and it does not add the email from facebook. Though the update callback returns the proper user with custom_fields and anything else I added. Never persists in ACS though. Side note: there is a bug with the ACS panel that shows incorrect record count (ie: 7 results was found, when there are only 2 records), refreshing a couple times solves it.
I created FB test users and played with multiple security settings, they all login and persist in ACS just fine. Cannot figure out why this specific user cannot be created in ACS... FYI: Not getting the "Email is already taken" error anymore though, since I am not trying to update the profiles email after login.
So is this still an issue for you?
Sorry if that was confusing but YES, this is still an issue for me because I have found it basically impossible to save that user into ACS. It worries me because I don't want to run into the same problem in production without knowing the cause. Also I would LIKE to put the email back into the login/update request as to save as much info as I can from the FB details.
We tried to reproduce this issue with Titanium SDK 3.1.3GA and were not able to reproduce it. Please test this issue using the latest release and let us know if the issue persists.
Test Environment:
OS: MAC OS X 10.8.5 Ti SDK: 3.1.3 GA, 3.2.0.x Ti CLI: 3.3.0 IOS simulator 7.0 Cloud Module 3.2.0 Facebook Module 3.1.1Test Code
Step to reproduces
Create a new project
Activate ACS cloud and Facebook module
Paste test code in app.js
Now run on iOS simulator
Click on Facebook login button
Success alert will display after FB login complete
Test Result
User email, first_name, last_name and custom_object update will successfully completed.Closing since a functional test sample has been posted. This is invalid with the latest version of the SDK & ACS.
[~creativejunky] Please let us know if you can still reproduce the issue and we would be happy to reopen the ticket and investigate it for you.