facebookarchive / php-graph-sdk

The Facebook SDK for PHP provides a native interface to the Graph API and Facebook Login. https://developers.facebook.com/docs/php
Other
3.17k stars 1.96k forks source link

Why Facebook login asks me every time when I do login in my application for the permissions of the pages? #1122

Open averbner opened 5 years ago

averbner commented 5 years ago

A few months ago this did not happen, but now every time I try to login in my web application Facebook asks me about the permissions in the pages (manage_pages), independently if I accepted them beforehand.

In the facebook api dashboard I have, those permissions: e-mail, manage_pages, default and user_friends:

[https://i.stack.imgur.com/hMTTW.png]

When I call to the api via php-sdk: public function getLoginUrl($scope = array(), $version = null) { $scope=array('email','public_profile','user_friends','manage_pages'); $version = ($version ?: FacebookRequest::GRAPH_API_VERSION); $this->state = $this->random(16); $this->storeState($this->state); $params = array( 'client_id' => $this->appId, 'redirect_uri' => $this->redirectUrl, 'state' => $this->state, 'sdk' => 'php-sdk-' . FacebookRequest::VERSION, 'scope' => implode(',', $scope) ); return 'https://facebook.com/' . $version . '/dialog/oauth?' . http_build_query($params, null, '&'); }

What I find strange is that if I do not request the manage_page, this does not happen and I can login without going through the dialogue window

Thanks.

miles-au commented 5 years ago

Were you able to eventually find the issue? I'm having a similar problem

averbner commented 5 years ago

No, I have not found a solution yet.