How to revoke a given Facebook token?
facebook, facebook-graph-api, oauth, oauth-2.0
Solution
Have a look at https://developers.facebook.com/docs/facebook-login/permissions/v2.0#revoking You can use
DELETE /{user-id}/permissions
to revoke a user's login to your app.
Furthermore, there's a section in the app's -> settings -> advanced screen where you can specify a so-called "Deauthorize Callback URL". This URL will be called by Facebook if a user actively disconnects your app from his profile settings. Unfortunately I can't find any docs on Facebook concerning this anymore. But there's a question about that here on SO: Facebook user deauthorizes the app
Problem
I'm using OAuth authentication to obtain a token from a Facebook user. My application edits - among other stuff - their Facebook pages. With that token I obtain a permanent token. The user can unlink its Facebook account from my app. When a user does so, I like to invalidate the token and remove my app from the users apps. It this possible?