On the interface, I initialized FB and login using:
window.fbAsyncInit = function () { FB.init({ appId: @facebookAppId, // App ID status: true, // check login status cookie: true, // enable cookies to allow the server to access the session xfbml: true, // parse XFBML oauth: true }); // Additional initialization code here FB.Event.subscribe('auth.login', function () { window.location = "/facebookPostAuth.aspx"; }); FB.Event.subscribe('auth.logout', function (response) { window.location = '/logout'; }); // Hack to fix http://bugs.developers.facebook.net/show_bug.cgi?id=20168 for IE7/8/9 FB.UIServer.setLoadedNode = function (a, b) { FB.UIServer._loadedNodes[a.id] = b; }; }; // Load the SDK Asynchronously (function (d) { var js, id = 'facebook-jssdk'; if (d.getElementById(id)) { return; } js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_US/all.js"; d.getElementsByTagName('head')[0].appendChild(js); } (document));
On an internal server, how to check if a login session exists using the Facebook C # SDK?
This is as much as I have, but I'm not sure how to transfer the APP ID / Secret to get additional information (for example, the email that I included in the registration area):
var client = new FacebookClient(); dynamic me = client.Get("me"); string firstName = me.first_name; string lastName = me.last_name; string email = me.email;
source share