The solution I use and recommend is to link your Facebook profile to your website by email address.
You need to integrate the authorization process with Facebook Oauth using the scope of the requested API that includes the 'email' value'.
This will allow you to call the Facebook API at this address below to ask for the user’s email.
https://graph.facebook.com/me
Then in your application you check if you already have any users with the email returned. If it does not exist, you create a new registration with the user data obtained from Facebook.
If it already exists, you simply start a logged in user session for the user of your website who has the email returned by Facebook.
I use this scheme on my websites since a couple of years ago and users loved it because I never ask for username and password. Users hate having to register a new password and do the usual email verification process. So with Oauth the two things are avoided.
Even so I allow the usual registration of user, password and email for those who do not have Facebook account or do not want to log in through Facebook.
In fact, I not only allow logging in through Facebook, but also through Google, Yahoo, Microsoft, Stackoverflow and Github. Most of these sites use the Oauth scheme. Some only provide email by Openid.
So I developed a generic class of PHP to Oauth which has built-in support for dozens of Apis, and can support many more with manual configuration.
It is not a specific class for Zend Framework, but can be used with any framework including Zend. Here’s an example of how log in to Facebook by Oauth using this class.
As there is already authentication via login (and by the possibility of part of my target audience not wanting to use Facebook for this purpose) it will be necessary that the two forms of login walk together. If I understand correctly, so that the user can log in again (by Facebook), the information for authentication will be oauth_token and oauth_token_secret? Would then be the inclusion of these two columns in my user table?? Another question, in Facebook Ids is that I can recover the id through the getuser() method, and how do I check the tokens?
– fabioAlmeida