Search code examples
facebookfacebook-graph-apioauthfacebook-opengraphfacebook-oauth

How can I obtain a valid OAuth Token with permissions with a Test user on Facebook


All I can get is a Anonymous user token through the dev test users area on Facebook. So when I fire a POST to auth with my web application using the said token I get:

"error parsing": "Facebook.FacebookOAuthException: (OAuthException - #100) (#100) Tried accessing unexisting field (friends) on node type (AnonymousUser

Do I have to generate the token in code with the permissions request set, or is there a quicker way?


Solution

  • Have you creeated your test users via the endpoint

    POST /{app-id}/accounts/test-users
    

    as described in https://developers.facebook.com/docs/graph-api/reference/app/accounts/test-users#publish

    I guess you have to manually "friend" two test users first, as describes here: https://developers.facebook.com/docs/graph-api/reference/test-user/friends I don't think that if you create a new test user, he'll automatically have some friends.