Kees C. Bakker
Kees C. Bakker

Reputation: 33391

How to revoke a given Facebook token?

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?

Upvotes: 3

Views: 9557

Answers (2)

Shummy1991
Shummy1991

Reputation: 75

@tobi solution didn't work for me, I had to pass the access token.

DELETE /{user-id}/permissions?access_token={access_token}

Upvotes: 1

Tobi
Tobi

Reputation: 31479

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

Upvotes: 7

Related Questions