Logout Facebook C # SDK

Hi
I'm having trouble trying to log out of facebook using the FB C # SDK.

Here is 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 always redirects to:

 http://m.facebook.com/ 

I am trying to redirect to an external site in this case bbc.co.uk, since in the first case I tried to redirect to localhost and had the same problem.

I really would not want to implement a javascript solution, since I already implemented my server-side login function.

Any suggestions are greatly appreciated.

+5
source share
1 answer

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

who offers to call:

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

What worked for me.

+10
source

Source: https://habr.com/ru/post/889803/


All Articles