facebookfacebook-fqlfacebook-php-sdkfacebook-authenticationfacebook-java-api

How implement Facebook-Login / facilitate site-register using Facebook


I want my users to be able to login or register on my Site using their Facebook-Account. Could be either like the user clicks the "Login using Facebook"-Button and is automatically logged in, while his data is saved to the db or he clicks "Login using Facebook" and gets my register-page filled with his data from Facebook.

I already tried the Facebook-register, but I think it doesn't solve the problem for me, because I don't want to change my entire register-dialog to Facebook. I want it additionally.

I managed to generate the "Login using Facebook"-Button using the Java-API. I also managed to get user-data via FQL using the PHP-API. But then I run into huge problems with the token.

I guess I read the (poor) documentation on FB-Developers for 20 times now. The Tutorials I found where either outdated or treat other cases. Besides that seemingly everyone uses another way to access FB.

Does anybody know an easy way to realize that and could clearly explain which functions, APIs, ... to use? Especially I feel like I still haven't totally understood that token-thing.


Solution

  • If someone is stuck with the same problems... For me it helped a lot to drop the JAVA-API and only rely on PHP.

    See as well this tutorial: http://thinkdiff.net/facebook/php-sdk-graph-api-base-facebook-connect-tutorial/ (It's also a bit outdated, therefore you have to delete the call to the getSession-Method.)