Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook logout C# SDK

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 a javascript solution as I have already implemented my login functionality server side.

Any suggestions much appreciated.

like image 970
Rauland Avatar asked May 16 '11 21:05

Rauland


1 Answers

After some time searching I came across this post: http://forum.developers.facebook.net/viewtopic.php?id=87109

which suggests to call:

this.NavigateUrl =  https://www.facebook.com/logout.php?next=[redirect_uri]&access_token=[access_token]

Which worked for me.

like image 124
Rauland Avatar answered Sep 28 '22 04:09

Rauland