facebook-c#-sdk

Error validating access token: The session is invalid because the user logged out

青春壹個敷衍的年華 提交于 2019-12-12 19:20:40
问题 My code: var fbWebContext = FacebookWebContext.Current; if (fbWebContext.IsAuthorized()) { var fb = new FacebookWebClient(fbWebContext); dynamic result = fb.Get("/me"); name.Text = result.name; } dynamic result = fb.Get("/me"); throws: (OAuthException) Error validating access token: The session is invalid because the user logged out. How should I change my code to prevent this? 回答1: You can ask for the "offline_access" extended permission. This will prevent this message and the user does not

Facebook fan page app

回眸只為那壹抹淺笑 提交于 2019-12-12 18:16:57
问题 I've built a few facebook apps using the c# sdk. and using code below to check if the user has liked the fan page and showing content to reflect that. protected void Page_Load(object sender, EventArgs e) { if (Session["SignedRequest"] != null) { signedRequest = Session["SignedRequest"].ToString(); } else { signedRequest = Request.Form["signed_request"]; } if (!string.IsNullOrEmpty(signedRequest)) { dynamic SignedRequestData; var DecodedSignedRequest = FacebookWebContext.Current.SignedRequest

How do I log a user out of my FB app but not Facebook site?

白昼怎懂夜的黑 提交于 2019-12-12 13:25:32
问题 I am using Facebook login integration on my asp.net site. What I want is that when a user logs off the site, I want him to also log off the FB application, but not Facebook itself. If I call FB.logout() , it logs off FB as well as the app. I guess what I want is to lose the acess_token cookie for the app, but I can't figure it out. 回答1: FB.api({ method: 'Auth.revokeAuthorization' }); 回答2: I dont think that is possible as the login for both the application and FB is done using FB credentials..

FaceBook API: Get the Request Object for a request Id - logged into the account that sent the request. Using the “Requests Dialog” API

强颜欢笑 提交于 2019-12-12 10:45:10
问题 I am using the "Requests Dialog" to create Facebook requests. Inorder to get the user that the requests were sent to I need to access the Request object using the graph API. I have tried most of the permissions settings that seemed appropriate (read_requests and user_about_me) to get the request object, but instead I get a false in the response. Am I using the wrong permissions? I am able to access the request object using the graph API from the account that the request was sent to. http:/

Convert FQL Results to custom class?

。_饼干妹妹 提交于 2019-12-12 10:26:29
问题 I am a fairly new C# programmer and am getting stuck on trying to convert FQL results into a custom class...for example, I am doing the following, but it seems like a lot of steps...I was just returning a datatable, but wanted the result to be strongly typed class collection. I'd appreciate any insights. I'm open to other ways of achieving similar results as well. Thanks, Chad public class FacebookFriends { public string FriendID { get; set; } public string FriendName { get; set; } public

Infinite refresh - Getting Started with the Facebook C# SDK

蹲街弑〆低调 提交于 2019-12-12 09:10:19
问题 I made the example in http://csharpsdk.org/docs/web/getting-started, and it works. But the javascript is constantly executing, so he's constantly do a post on the server.. Always invoke the handler who Redirect to About.aspx and codebehind read the name, ID and other user information. form.setAttribute("action", '/FacebookLogin.ashx'); In my MasterPage I have the < div id="fb-root"> and the script code right after the tag < body> (inside the body). And in my Default.aspx I have the button to

How to send appsecret_proof using facebook c# SDK?

混江龙づ霸主 提交于 2019-12-12 07:24:34
问题 I want to use "Require App Secret" (Require app secret for server API calls) on my facebook app, But if I do - I'm getting the following error: (GraphMethodException - #100) No appsecret_proof parameter was specified Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: Facebook.FacebookApiException: (GraphMethodException - #100) No

'LoginButton Control' sample for Facebook SDK for .NET do not show GraphUser objects

给你一囗甜甜゛ 提交于 2019-12-12 06:04:42
问题 I am trying to learn using the Facebook SDK for .NET. Specifically for Windows Phone 8.1 Universal App (not Silverlight). For this I have build the 'LoginButton Control' sample that can be found here: http://facebooksdk.net/docs/windows/controls/login-ui-control/ I have sucessfully logged in to Facebook with the sample, but the 'Name' newer shows up. It is related to this part of the code: <!--user information--> <StackPanel HorizontalAlignment="Right"> <TextBlock HorizontalAlignment="Center"

SL4 Facebook application no longer retrieves access_token

天大地大妈咪最大 提交于 2019-12-12 06:02:40
问题 I have an SL4 Out of Browser application which has been working for several months. As of right now, it appears it will not longer retrieve an access_token from Facebook. I am using facebook-c#-sdk v4.1.1. Some partial code is posted below: void FacebookLoginBrowser_Loaded(object sender, RoutedEventArgs e) { if (!loggedIn) { LoginToFacebook(); } } private void LoginToFacebook() { dynamic parms = new System.Dynamic.ExpandoObject(); parms.display = "popup"; parms.client_id = appId; parms

Get oAuth 2.0 access token from asp.net webforms iframe canvas application

百般思念 提交于 2019-12-12 05:01:26
问题 The question says it all: How can I get an access token to use on graph api calls from a asp.net webforms 4.0 iframe canvas app. My canvas application has been configured to enable the OAuth 2.0 for Canvas (beta) among other things. This means I am getting the signed_request parameter on my iframe which I am successfully reading. From the oficial documentation on canvas authentication The signed_request parameter is the concatenation of a HMAC SHA-256 signature string, a period (.), and a