facebook-c#-sdk

Facebook logout C# SDK

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 01:58:44
Hi I am having trouble trying to logout of facebook using the FB C# SDK. Here's a sample of my test var oauth = new FacebookOAuthClient(); oauth.AppId = fbSection.AppId; string bbc = @"http://www.bbc.co.uk"; var logoutParameters = new Dictionary<string, object> {{ "next", bbc }} ; this.NavigateUrl = oauth.GetLogoutUrl(logoutParameters).AbsoluteUri; The problem is that it´s always redirecting to: http://m.facebook.com/ I'm trying to redirect to an external site in this case bbc.co.uk, as in first case I tried redirecting to localhost and had the same problem. I really wouldnt like to implement

(OAuthException - #2500) An active access token must be used to query information about the current user

空扰寡人 提交于 2019-11-28 00:25:46
string accessToken = GetAccessToken(); string accessKey = accessToken.Split('=')[1]; var client = new FacebookClient(accessKey); dynamic me = client.Get("me"); here is the method to get access token and it does return a valid access token private static string GetAccessToken() { // Create a request using a URL that can receive a post. WebRequest request = WebRequest.Create("https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=201193246663533&client_secret=secretkeyhere"); // Set the Method property of the request to POST. request.Method = "POST"; // Create POST

ASP.NET website authentication with facebook

a 夏天 提交于 2019-11-28 00:16:20
I've seen a lot of documentation about integration between ASP .NET web sites and Facebook, but I haven't found a simple working example, even using Facebook C# SDK. All I want is a "login with Facebook" example, and to get basic user information (such as name, email and photo). Can you guys help me please? Thanks a lot! as you say using Facebook C# SDK , then here is path and some code for canvas application: 1- Create your web application from visual studio 2- install nuget and get by nuget Facebook C# SDK 3- from https://developers.facebook.com/apps/ create and configure your app. 4- Your

Facebook C# SDK and Access Token

99封情书 提交于 2019-11-27 23:27:36
问题 I'd like to be able to authenticate myself (my profile, not just my app) on my own web application using the Facebook C# SDK. Using the Graph API, I can get an access token, but that token does not seem to work properly with the Facebook C# as it seems to be stateless. The error that is thrown is: (OAuthException) An active access token must be used to query information about the current user. I've poked around the Facebook C# SDK and documentation and most of the info I'm seeing is to

Is it possible to configure a Facebook app to be used across multiple domains?

无人久伴 提交于 2019-11-27 22:50:47
We have a website application that is deployed and customised for multiple customers, across different domains, we are developing a Facebook Connect app within this website, so people can see what their friends are doing through our sites. I've set the site url and canvas url in my Facebook app to my localhost for debugging, I was wondering, what if I wanted to use this application across multiple domains? Will facebook only allow postback to one domain per application? Is it possible to configure multiple domains? EDIT If this isn't possible how are large companies managing multiple domains?

How to get Page Access Token by code?

不打扰是莪最后的温柔 提交于 2019-11-27 21:34:55
I need to generate a Page Access Token for a webpage that I have, this token will be used by the webpage to post to its Facebook Page feed. This is what I do : Go to Graph API Explorer Choose my app from the dropdown Click Get Access Token Choose correct permissions( manage_pages / user_events ) To get the Page Access Token I have to run me/accounts in the Graph API Explorer. This will show all the pages I got with a new Page Access Token (short lived(about 60 min)) to each one. This Page Access Token will work just fine to use in my C# code to post to the feed. Problem When another user uses

How to get an access token using C# SDK

老子叫甜甜 提交于 2019-11-27 20:54:19
I updated the Facebook SDK to 6.0.10 and some code that used to work is not working anymore. I used to post on users' wall use the method below. The class FacebookClient used to take the AppId , and AppSecret and I didn't gave it any access token for my application. string uId = "SomeUid"; FacebookClient fb = new FacebookClient(AppId,AppSecret ); string userFeedPath = String.Format("/{0}/feed", uId); dynamic parameters = new ExpandoObject(); parameters.link = "Test@test"; parameters.message = "test"; try { dynamic result = fb.Post(userFeedPath, parameters); } catch(Exception ex) { } Now even

Retrieve Access Token Using Javascript API

时光总嘲笑我的痴心妄想 提交于 2019-11-27 19:56:24
This is a follow up to the topic: Passing the signed_request along with the AJAX call to an ActionMethod decorated with CanvasAuthorize Since I couldn't get the signed_request to be anything other than null, I thought I'd authenticate the user on the client side, then send the access token to the server side (ASP.NET MVC) along with the AJAX call. Unfortunately, I cannot get that to work either! Here's my Javascript code (which I've got from the documentation): function postOnFacebook(msg, itemLink, pic, itemTitle, signedReq) { var siteUrl = 'http://www.localhost:2732'; var appID =

Fans-only content in facebook with asp.net C# sdk

亡梦爱人 提交于 2019-11-27 12:15:22
Hi i'm developing an application in facebook with c# sdk and i want that the user whom liked my page can only use my application. (Like woobox ) I found some solutions in php in this link but there isn't any source about .net how can i get the liked info in ASP.NET I find another examples in php in this link again but i can't find c# answer :\ Thanks Imran You get signed request when your web page is loaded within facebook canvas app; you should be able to parse signed request something similar to following: if (Request.Params["signed_request"] != null) { string payload = Request.Params[

Get application id from user access token (or verify the source application for a token)

泪湿孤枕 提交于 2019-11-27 10:26:00
I found this question , which has an answer, but facebook changed the token format since then, now it is something like: AAACEdEose0cBACgUMGMCRi9qVbqO3u7mdATQzg[more funny letters]ig8b3uss9WrhGZBYjr20rnJu263BAZDZD In short, you cannot infer anything from it. I also found the access token debugger , which shows the information I am looking for if you paste a token in, which is nice, but does not help me do it programmatically. Point is, if someone gets a token for a user, he can use it to access the graph, which is what I do in my application - I want to be sure that people are forwarding the