Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook API SDK revoke access

How can I allow a user to revoke access to my application using their API service, SDK. http://developers.facebook.com/docs/sdks/

Looking at the documentation I can't find anything about revoking the access.

like image 494
Frank Avatar asked Jan 29 '12 01:01

Frank


People also ask

How do I revoke third party apps on Facebook?

Tap in the top right of Facebook. Scroll down and tap Settings. Go to the Security section and tap Apps and Websites. Tap Edit next to Apps, Websites and Games, then tap Turn Off.

How can I get my Facebook API key and secret?

Now expand the Setting menu and select Basic. Here you can find the App ID and App Secret. Then click on the “Show” button in the “App Secret” text box. You can copy the “App Id” and “App Secret” which you can use for your Facebook API calls.


2 Answers

For the FB JavaScript SDK:

FB.api('/me/permissions', 'delete', function(response) {
    console.log(response); // true
});
like image 154
Zach Lysobey Avatar answered Sep 17 '22 11:09

Zach Lysobey


in the graph API for the user object you can issue an HTTP DELETE request to /PROFILE_ID/permissions to revoke authorization for an app.

from the official documentation (developers.facebook.com/docs/reference/api/user/):

You can de-authorize an application or revoke a specific extended permissions on behalf of a user by issuing an HTTP DELETE request to PROFILE_ID/permissions with a user access_token for that app.

Parameter Description Type Required permission The permission you wish to revoke. If you don't specify a permission then this will de-authorize the application completely. string no You get the following result.

Description Type True if the delete succeeded and error otherwise. boolean

like image 33
thermz Avatar answered Sep 18 '22 11:09

thermz