secret
Created

GetFacebookContext

  • Download Gist
gistfile1.cs
C#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
private static FacebookContext GetFacebookContext(string signedRequest)
{
var client = GlobalFacebookConfiguration.Configuration.ClientProvider.CreateClient();
dynamic parsedSignedRequest = client.ParseSignedRequest(signedRequest);
string accessToken = parsedSignedRequest.oauth_token;
client.AccessToken = accessToken;
return new FacebookContext
{
AccessToken = accessToken,
Client = client,
Configuration = GlobalFacebookConfiguration.Configuration,
UserId = parsedSignedRequest.user_id,
SignedRequest = parsedSignedRequest
};
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.