I have a voting app built on PHP that takes Facebook logins (uses PHP SDK). You need to connect with your Facebook account to vote. We decided to use Facebook logins to prevent vote frauds.
After logging in with the Facebook account, this is what happens:
Now, here lies the problem. I can simulate an HTTP request with fake identification details and the app still thinks it's a legitimate request and so, records the vote. So, someone can set up a script to generate random identification details, send them over HTTP requests ultimately leading to a lot of fraud votes.
Maybe, after the poll closes, we can test with the profile URLs to see whether the profiles exist or not but again, two issues here:
So, is there a way to allow only legitimate logins through the app? Something like a test before recording the vote.
I guess, a CAPTCHA can help but that will interfere with a quick vote experience we want our users to have.
Thank You!
Putting that stuff in the form, and doing nothing else is not the way to do this.
How this should work:
$uid = $facebook->getUser();
to get the userid for the user who has just logged in. If it is 0, the login failed.EDIT
Since I am not fully aware of the various methods available by the FB API, I would defer to @Igy on this (see his comment about retrieving an access token to verify the account). Though, I don't know what ability the user would have to be able to fake an account id returned by the API.