This project is read-only.

Usage Instructions: Using the old Facebook Connect JS libraries

Is this the right set of instructions for you?

If you are using the old-style Facebook Connect JS libraries (the src of your javascript will be something like:, then this page is for you. If you are using the Open Graph API, please see Usage Instructions: Using the Open Graph API.


First of all, create an instance of FBConnectAuthentication, passing your Facebook Application's API Key and Secret, then call the Validate and GetSession methods from within a web request. The authentication and is done automatically using the cookies in the request, and most importantly, the Facebook Connect signature is verified.


You can use Facebook Connect Authentication for ASP.NET by adapting the following example:

FBConnectAuthentication auth = new FBConnectAuthentication(apiKey,appSecret); //Note this is the "api key"
if (auth.Validate() != ValidationState.Valid)
    // The request does not contain the details of a valid Facebook connect session - you'll probably want to throw an error here.
    FBConnectSession fbSession = auth.GetSession();
    string userId = fbSession.UserID;
    string sessionKey = fbSession.SessionKey;
    // These values can now be used to communicate with Facebook on behalf of your user - perhaps using the Facebook Developer Toolkit
    // The expiry time and session secret is also available.

Last edited Jun 16, 2010 at 8:34 PM by ACreeger, version 4


No comments yet.