Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting App Access Token for facebook app?

I have read this: trying to get app access token

And it doesn't work... I'm getting the following error:

"error": {
   "message": "An active access token must be used to query 
                          information about the current user.",
  "type": "OAuthException",
  "code": 2500
}

I need the app access token in order to create open graph objects that are owned by the application. I know how to create objects owned by the users, but I just cant find the correct way of creating the App access token.

AppId -> doesn't work... AppId|AppSecret -> doesn't work.... App ClientToken -> doesn't work....

Anyone know this?

like image 724
Roger Johansson Avatar asked Aug 04 '13 18:08

Roger Johansson


People also ask

How do I get my Exchange token on Facebook?

At a high level, you obtain a long-lived token for the client by: Using a valid, long-lived access token, your server sends a request to get a code from Facebook. Facebook sends a code back to your server and you securely send this code to the client.

How do I get app token?

To access the Manage App Tokens page, or view app tokens: In the App bar, select the app you want, click Settings, then click App properties. Click Advanced settings to expand the section, if needed. In Security options, find the Require Application Tokens checkbox.

What is access token in Facebook?

An access token is an opaque string that identifies a user, app, or Page and can be used by the app to make graph API calls. When someone connects with an app using Facebook Login and approves the request for permissions, the app obtains an access token that provides temporary, secure access to Facebook APIs.

How do I verify my Facebook access token?

You can simply request https://graph.facebook.com/me?access_token=xxxxxxxxxxxxxxxxx if you get an error, the token is invalid. If you get a JSON object with an id property then it is valid. Unfortunately this will only tell you if your token is valid, not if it came from your app.


1 Answers

You can get it directly from the Access Token Tool.


Please note: For security, app access token should never be hard-coded into client-side code, doing so would give everyone who loaded your webpage or decompiled your app full access to your app secret, and therefore the ability to modify your app. This implies that most of the time, you will be using app access tokens only in server to server calls.

like image 194
Sahil Mittal Avatar answered Sep 20 '22 11:09

Sahil Mittal