Facebook Graph API returns false for page accounts

I am trying to use facebook connection for my website. Everything is fine, when I try to log in as a regular user, all the correct information is returned. However, when I log in as my "PAGE" account, everything starts to get weird. After a successful login, if I use the following: https://graph.facebook.com/me/?access_token= {access token}, I return "false". If instead of replacing ā€œIā€ with the account ID of the page, I will return the correct information to you.

Another problem is that after logging in to the session cookie, fbs_appID set the wrong "uid" after successfully logging in as "PAGE". Everything is fine with a regular user account.

All settings on my page are "13+", and there are no restrictions on the country.

Can anybody help?

+5
source share
4 answers

We get the same behavior.

If you sign up when you sign up as a Facebook page, Facebook usually displays a dialog that says "Unable to log in to the Facebook page. Switch to user xxx."

Thus, you should always enter a regular user into your FB connection code.

, Facebook Facebook. , , .

, , , , Facebook.

, : ( ):

GET /oauth/access_token?client_id=xxxxx&redirect_uri=xxxxx&client_secret=xxxx&code=xxx HTTP/1.1
Connection: close
Host: graph.facebook.com


HTTP/1.1 200 OK
Cache-Control: private, no-cache, no-store, must-revalidate
Content-Type: text/plain; charset=UTF-8
Expires: Sat, 01 Jan 2000 00:00:00 GMT
Pragma: no-cache
X-FB-Rev: 401390
X-FB-Server: 10.42.17.21
Connection: close
Date: Wed, 06 Jul 2011 10:38:11 GMT
Content-Length: 122

access_token=xxxx&expires=4909



GET /me?access_token=xxxx HTTP/1.1
Connection: close
Host: graph.facebook.com

HTTP/1.1 200 OK
Cache-Control: private, no-cache, no-store, must-revalidate
Content-Type: text/javascript; charset=UTF-8
ETag: \"7cb6efb98ba5972a9b5090dc2e517fe14d12cb04\"
Expires: Sat, 01 Jan 2000 00:00:00 GMT
P3P: CP=\"Facebook does not have a P3P policy. Learn why here: http://fb.me/p3p\"
Pragma: no-cache
X-FB-Rev: 401390
Set-Cookie: datr=aTsUTlxHtaaaK67aCdYmQbCO; expires=Fri, 05-Jul-2013 10:39:37 GMT; path=/; domain=.facebook.com; httponly
X-FB-Server: 10.32.3.116
Connection: close
Date: Wed, 06 Jul 2011 10:39:37 GMT
Content-Length: 5

false
+1

, Graph API. , api.

+1

I think something is wrong with your registration part.

If you are using the Javascript SDK:

Try console.dir(FB.getSession());

If you are using the PHP SDK: then try:

$session = $facebook->getSession();
print_r($session);

And check the console if you get the correct session or not.

http://graph.facebook.com/mealways available until you log in. It does not even require any additional permissions.

-1
source

Remove age and / or country restrictions from the page settings.

-3
source

All Articles