Facebook注销C#SDK [英] Facebook logout C# SDK

查看:109
本文介绍了Facebook注销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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆