Set Facebook Callback URL

I am starting to work with FB integration on my website, and I found that the documentation on Facebook is not so good.

I want to create a login button on my page and then process the response on the server side, but I cannot find a good way to do this.

I use the XFBML tag, but the only event that I know about is "onlogin" (which, by the way, I can not find in the documentation), which allows me to set the javascript function as a callback, the problem is that I will need to call FB.getLoginStatus to get the registered information, and then redirect the user to the page I need, as well as manually transfer the registered information about the user in the query line.

eg. Put this code in the onlogin callback function

FB.getLoginStatus(function(response) { if (response.session) { window.location.replace('/Account/ProcessFbLogin?uid=' + response.session.uid ...'); } } 

I think there should be a better way to do this, but I just can't find it.

thanks

+4
source share
2 answers

A better way might be OAuth Dialog , where you can specify the redirect_uri parameter.

+1
source

check out SocialAuth ... super cool and easy to use!

+1
source

All Articles