ASP.NET MVC: Facebook C# SDK 5.4.1 Logout - asp.net-mvc

I know this seems like yet-another post on the subject but the other posts did not help me.
I'm trying to logout my facebook user from my webiste through c# SDK (version 5.4.1) but I can't find a single clue on how to do this. I only find how to do this with previous versions, or javascript logout (which I don't want).
I've also seen this post Cannot Logout of Facebook with Facebook C# SDK but I don't know how to get the access token through C# SDK and I even don't know if this method is indeed working.
Thanks in advance.

Navigate to https://www.facebook.com/logout.php?access_token=....&next=...
Make sure your next url is not any random url but the url which is part of the site url.

Related

Oauth 2.0 facebook provider in Chrome package app. Redirect-url issue

I'm dealing with Oauth 2.0 facebook provider in Chrome package app using chrome.identity namespace and the method launchWebAuthFlow (https://developer.chrome.com/apps/identity#method-launchWebAuthFlow) .
My url of the launchWebAuthFlow method is "https: //www.facebook.com/dialog/oauth?client_id={app-id}&redirect_uri={redirect-uri}"
Reading the docs of this api, the redirect-uri must to be like this https ://abcdefghijklmnopqrstuvwxyzabcdef.chromiumapp.org/provider_cb where abcdefghijklmnopqrstuvwxyzabcdef is the ID of the chrome app. (https://developer.chrome.com/apps/app_identity)
When i run this code, facebook shows me a popup, "configuration of app doesn't allow the given url" instead the facebook login form. Facebook has to be blocking the redirect-uri but i don't know how to proceed.
Thanks in advance.
I answer myself.
It's like Xan said, has to be on the configuration of the Facebook app and that is it. The url https://abcdefghijklmnopqrstuvwxyzabcdef.chromiumapp.org/provider_cb has to be written in the 'Site Url' in the Facebook app form configuration.

Google one time code flow oauth login is not working in windows phone IE

Im using google one time code flow oauth login for my site, which described here,
Now my problem is the link is working fine and google is asking my username and password then it is just hagging over there no response and not redirecting to my site only in windows phone IE.
My guess is that it is opening in the same window so it will not able to find the callback function in my site,
I dont know how to fix this now. Anyone please help me to fix this.
Thank you in advance.

Migrating from FBConnect to Facebook sdk

I would like to migrate from fbconnect to facebook sdk. My application is already running on fbconnect. Can i simply delete just delete the fbconnect files(such as FB request, Facebook, FBDialog) files and simply add Facebook SDK framework in?
When I do that, i get errors like:
1)No Facebook.h, No FBDialog.h , NO FBRequest.h so on...
How to solve this?
simply replacing the framework with previous FBConnect files will not work. They are now using "FBSession" concept for logging in and changed posting methods also.
So it would be better for you to follow the document here.

How to use yammer's oauth2 from iOS?

I'm trying to get a iOS client to make use of Yammer's Oauth2 to validate a user. I first tried the GTM-OAuth2 code, but I cannot get it to understand the response from Yammer. It appears that the GTM code is expecting the access_code as a query parameter, where as Yammer is returning it as a uri fragment. I hack he GTM code to see the fragment, but now it appears to be thinking that there is an error because the code and message fields are not in the response from Yammer.
I've also tried to use OAuth2Client api but the problem there is that Yammer does not seem to want to use the redirect_uri I pass to it, so Safari never gets the custom url and therefore never calls back to the app.
Does anyone have a working example of using Yammer's OAuth2?
I would also be interested if anyone has got GTM-OAuth2 to work with Facebook?
Yeah Yammer has a shitty implementation of oAuth. Looks like each service has taken its own implementation of oauth. anyway yammer requires the user to copy a 4-digit code from its website, go back to your service paste that code in your website. Only then you can request for access code.
check this - http://www.tutorialjinni.com/2011/04/yammer-api-example.html (its in php but hope you can get the gist).
Nothing you can do about it but a fun read - Yammer API sucks

Making Facebook Connect work with ASP.Net MVC

I am trying to integrate my ASP.Net MVC site with Facebook Connect.
For some odd reason after the login popup loads and connets, HttpContxt.Current.Requet.Cookies[Session_Key_Cookie_Name] still returns NULL!
What could be the possible reason?
Thanks
P.S
I also noticed that although I've set localhost/xd_receiver in the Site.Master FB.init call, xd_receiverController.cs doesn't get called (Set a breakpoint in it)
( I followed all those posts/articles when buiding my site:
http://devtacular.com/articles/bkonrad/how-to-retrieve-user-data-from-facebook-connect-in-aspnet/ ,
Facebook Connect and ASP.NET,
http://facebooktoolkit.codeplex.com/Thread/View.aspx?ThreadId=45825,
http://my6solutions.com/post/2009/04/05/Integration-of-Facebook-Connect-on-ASP-NET-MVC.aspx)
Found a solution, hopefully this will save people the days I have burned trying to use ASP.Net and Facebook Connect.
The issue is simple:
The connect url property in your facebook application settings page MUST be your domain name AND the xd_receiver path in the FB.init is the relative path from the page your connect button is on!
otherways it wont save the session cookie in the right place.
Goodluck

Resources