Why do I need authentication when all I want is public Facebook data?

后端 未结 2 697
梦谈多话
梦谈多话 2021-01-07 07:00

I am creating an app using the Facebook C# API.

I want to read the data on this wall, but when I call the API and essentially hit this URL: https://graph.facebook.co

相关标签:
2条回答
  • 2021-01-07 07:10

    Because Facebook does not mind you as a user seeing this information but does not want applications to be able to harvest data. Obviously it would be a lot faster for you to use the graph api to get everyone's names off their posts to the group wall (hypothetical) than for you to do it manually. The only publicly available information without an access_token is the basic user information (and this is only for users and not any other object). In order to achieve what you want you will have to acquire an access_token.

    This is the same as the fact that as a user you can see anyone's friends when logged into Facebook, but as an application you can only see an Authorized user's friends.

    You can, however, authenticate your application with the ability to access non-user specific private information by authenticating via the following method:

    1. Make a GET request to:

      https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=CLIENT_ID&client_secret=CLIENT_SECRET
      
    2. Facebook returns:

      access_token=SOME_TOKEN
      
    3. Use this token as your access token and it should allow you to access the group. I have tested this with my application and can confirm it works.

    4. You request the wall information via the request:

      https://graph.facebook.com/123176767150/feed?access_token=SOME_TOKEN
      

    See here under the Authenticating as an Application section

    0 讨论(0)
  • 2021-01-07 07:21

    so that FB knows who's requesting the data. FB needs to know the agent that accesses any type of data.

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