Auto Facebook OAuth from ASP.NET C#

前端 未结 1 1012
我寻月下人不归
我寻月下人不归 2020-12-22 13:40

I need help on oAuth authentication to facebook. I am able to do the steps that facebook API mentioned and successfully authenticated, get my profile information as well as

相关标签:
1条回答
  • 2020-12-22 14:09

    What you need to get is an access token. This is a key which allows you continued access to the account until your the token expires or the user cancels it.

    When you first authenticate if you have set the required permissions you get an authtoken which you can store and use to initiale further calls.

    var client = new FacebookClient("my_access_token");
    dynamic result = client.Get("19292868552_118464504835613");
    string id = result.id;
    string fromName = result.from.name;
    string fromCategory = result.from.category;
    string message = result.message;
    int likes = result.likes;
    foreach (dynamic comment in result.comments.data) {
        string commentId = comment.id;
        string commentMessage = comment.message;
    }
    

    see this article for details about the process:

    http://benbiddington.wordpress.com/2010/04/23/facebook-graph-api-getting-access-tokens/

    0 讨论(0)
提交回复
热议问题