fabian
fabian

Reputation: 5463

ERROR: FacebookApiException [ 190 ]: Invalid OAuth 2.0 Access Token

What's wrong with this?

    public function hasAppPermission($permission) 
{
    return $this->api(array('method' => 'users.hasAppPermission', 'access_token' => $this->getAccessToken(), 'ext_perm' => $permission));
}

Output:

array(
['method'] => 'users.hasAppPermission'
...
['access_token'] => '290034239987|2.SvGXXig_x3yjCkz7QDz4Wg__.3600.2293826300-130050996538485|UcFS331a75AR389Vtjz9rgDmpUg'
...
['ext_perm'] => 'user_birthday'
...
)

Upvotes: 0

Views: 3174

Answers (2)

Agent_x
Agent_x

Reputation: 99

Are you testing this in a home server like xampp or similar? If it´s, there is the problem with authorization token. Because there are any valid certificate in localhost.

Upvotes: 1

ifaour
ifaour

Reputation: 38135

Maybe this is not an infinite access_token?
Anyway, I don't think this is how it should be done, refer to this tutorial for more information:

$isGranted = $facebook->api(array(
    "method"    => "users.hasAppPermission",
    "ext_perm"   => "publish_stream",
    "uid"       => 579187142
));
if($isGranted === "1")
    echo "Permission granted!";

Upvotes: 0

Related Questions