Where did FacebookOAuthClient go?

雨燕双飞 提交于 2019-12-04 05:03:57
prabir

It has been removed.

Starting with v6 you can now use it with normal FacebookClient.Get() method. http://csharpsdk.org/docs/faq.html

How do I get a Facebook Application Access Token?

var fb = new FacebookClient();
dynamic result = fb.Get("oauth/access_token", new { 
    client_id     = "app_id", 
    client_secret = "app_secret", 
    grant_type    = "client_credentials" 
});

How do I exchange code for access token?

var fb = new FacebookClient();
dynamic result = fb.Get("oauth/access_token", new {
    client_id     = "app_id",
    client_secret = "app_secret",
    redirect_uri  = "http://yoururl.com/callback",
    code          = "code"      
});

How do I extend the expiry time of the access token?

var fb = new FacebookClient();
dynamic result = fb.Get("oauth/access_token", new {
    client_id         = "app_id",
    client_secret     = "app_secret",
    grant_type        = "fb_exchange_token",
    fb_exchange_token = "EXISTING_ACCESS_TOKEN"
});
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!