joshholat
joshholat

Reputation: 3401

Facebook PHP SDK - Remove/expire permissions and app from a user's profile

I'm currently working on adding Facebook integration into a website of mine via the PHP SDK. I'm requesting and planning to use the offline_access permission so I'm storing the access_token in a database. However, I'm giving the user the option to remove the integration with Facebook after they add it and therefore then removing this access_token from the database. This is where the issue comes in:

The first time they add the integration, my app redirects to Facebook correctly and asks for the permissions, etc. Then, however, if they remove the integration and then re-add it, it doesn't ask for the permissions again (which makes sense since those permissions are still technically given to my app on that user's profile unless they went into Facebook and manually deleted them).

My question is if theres a way to tell Facebook to remove my app and its permissions from that user's Facebook profile so that if they go to re-add the integration, they are once again prompted to accept the permissions.

Perhaps something like $facebook->expireAllAppPermissions() I guess.

Upvotes: 1

Views: 2292

Answers (2)

rvaldron
rvaldron

Reputation: 106

You can issue an HTTP DELETE request to /PROFILE_ID/permissions to revoke authorization for an app.

Upvotes: 3

Khawer Zeshan
Khawer Zeshan

Reputation: 9646

this is because you are just deleting access token from your data base , it will not remove your app from user profile. user is still authenticated with your app. he has to remove the app manually.

Upvotes: 0

Related Questions