Facebook php authentication returns user denial rights when I click "allow",

I am using php sdk for my application. I get a login url with $ facebook-> getLoginUrl () and some advanced permissions.

when the user is redirected to this page, a dialog box with rights is displayed. when it allows clicks, it redirects back to my site, but with error_reason = user_denied passed in the url.

I tried to remove the application from my facebook user account, deleting all cookies / caches in the browser, still can not get it to work.

I saw that there is another question on StackOverflow on this issue, but didn’t get an answer ... Facebook authentication returns "denied" even if I click allow

+4
source share
2 answers

Took me a little to figure it out. The problem is that you are in sandbox mode, but you cannot disconnect it.

When you add a Facebook user to your application (as a tester, developer, administrator, etc.), they initially receive the status of "Pending". Although the user has this pending status, they can view your Facebook application, but cannot grant him privileges.

To remove the waiting status, you need the person to whom you have granted this role to log in to your account. In your notifications, you will see that they have been given the role of the Facebook application. Then the user must click on this notification and accept it. Once it is accepted, the user is no longer waiting and can accept requests for obtaining Facebook privileges from the application.

+11
source

I fixed this problem by disabling application sandbox mode.

0
source

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


All Articles