Hi guys,
I am integrating Facebook and twitter authentication to my new website.
When the user use either facebook or twitter to authenticate, I get the AccessToken and store it in DB and link it to the UserID of the logging in user ( the user should link his facebook or twitter account to his existing or new account on my site)
now the next time, he authenticate, I get the AccessToken, check in the DB if this accesstoken is linked to any user, if so I directly log him in.
Now in twitter, I always get the same accesstoken, but in facebook ( called SessionKey) it is not fixed but it contains the UserID.
The question is how can I link a user facebook account to an account on my site ? should I use his facebook ID and link it to my site UserID ?
Thanks.