Is there a way to remove users for your Facebook application?

There is documentation for tester users in the online documentation for Facebook developers, but how do you delete actual users where the application no longer appears in the application list? This is known for knowing access_token and facebook_user_id .

Used to remove test users:

 https://graph.facebook.com/893450345999?method=delete&access_token=A2ADI1YMySweBABBGrWPNwKMlubZA5ZCrQbxwhtlEd9FIQUrOVjsGD3mnIWEbUhzDz7dkuBekMFdHvjvJ9CZAU7EMSSaZBsgN60FkMCi3AAZDZD 

Running a test user link causes the following error:

 "error": { "message": "(#100) Can only call this method on valid test users for your app", "type": "OAuthException", "code": 100 } 
+6
source share
2 answers

You are looking to opt out of using the application:

You can revoke the authorization of the application or revoke certain extended permissions on behalf of the user by sending an HTTP DELETE PROFILE_ID request / permissions using the access_token user for this application.

permission - the permission you want to revoke. If you do not specify permission, this will completely cancel the authorization of the application .

To resolve this issue, follow these steps:

 https://graph.facebook.com/me/permissions?method=delete&access_token=... 

Once the application is canceled, it will not appear in the list of user applications.

+10
source

Real users "delete" themselves from your application, when they remove your application from their account, you do not need to do anything.

If you want to know when users deactivate your application like this, you can specify the URL for callback forwarding in your application settings. As described in the docs at https://developers.facebook.com/docs/authentication/ :

After uninstalling the application, we will send an HTTP POST request containing the only signed_request parameter, which, after decoding, will provide a JSON object containing the user_id of the user who has only canceled the authorization of your application. You will not receive the user's access token in this request, and all existing user access tokens that were previously issued on behalf of this user will become invalid.

UPDATE . To remove your own application from authorized users, enter HTTP DELETE at https://graph.facebook.com/[userid]/permissions?access_token=... according to https://developers.facebook.com/docs/reference/ api / user / .

Typically, Graph API calls also support HTTP POST with the optional parameter method=DELETE , in case DELETE calls are not possible / supported.

+4
source

Source: https://habr.com/ru/post/916408/


All Articles