Facebook注销C#SDK [英] Facebook logout C# SDK
问题描述
您好
使用FB C#SDK,我无法尝试注销Facebook。
以下是我的测试示例
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;
问题是它总是重定向到:
http://m.facebook.com/
在这种情况下,我正在尝试重定向到外部网站bbc.co.uk,因为在第一种情况下,我尝试重定向到localhost并且有相同的问题。
我真的不想实现一个javascript解决方案,因为我已经实现了我的登录功能服务器端。
任何建议非常感谢。
经过一段时间的搜索,我遇到了这篇文章: http://forum.developers.facebook.net/viewtopic.php?id=87109
建议调用:
this.NavigateUrl = https://www.facebook.com/logout.php ?next = [redirect_uri]& access_token = [access_token]
>
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.
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.
这篇关于Facebook注销C#SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!