Facebook logout C# SDK

时光怂恿深爱的人放手 提交于 2019-12-17 17:03:37

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/6023908/facebook-logout-c-sharp-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!