One use case is the following.
I ask for a Facebook access token to new users with the offline_access
permission and I store it for later use. If the user remove in his settings the offline_access
permission the token becomes invalid.
I would like to be able to test (maybe using the graph API) if the token I have still have the permissions I asked for, without waiting the user to log out to try to make an API call.
Tap in the top right of Facebook. Scroll down and tap Settings. Go to the Permissions section and tap Apps and Websites. Go to Apps, Websites and Games and tap Edit.
Access tokens are used in token-based authentication to allow an application to access an API. The application receives an access token after a user successfully authenticates and authorizes access, then passes the access token as a credential when it calls the target API.
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.
It's unlikely that you should ever share a personal access token, but if you have a bot account used by the whole team, then sharing the tokens could also be okay.
Just call the Permissions graph api method. You could parse the json response and look to see if "offline_access" exists or not. The url format is: https://graph.facebook.com/me/permissions?access_token=... You can access an example of it by going here and clicking the permissions link there. The
You can also use their debug tool to check a token, useful for confirming the level a token has and what it has access to for debugging:
https://developers.facebook.com/tools/debug/accesstoken/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With