0

I am asking user to login from FB JS SDK. I get accessToken and userID and I save it in a database. And then internally every few minutes I call a php function at the server to check if there is an entry in the database and get all the information I can from accessToken.

The server side code is:

$facebook = new Facebook(array(
  'appId'  => 'xxx',
  'secret' => 'xxxx',
 ));

$facebook->setAccessToken($savedAccessToken);

$user = $facebook->getUser();

$profile = $facebook->api('/me');

I am able to login as $user is not 0. But I get the error as:

OAuthException: The access token could not be decrypted

Please help me resolve the issue. Thanks

Pratik Poddar
  • 1,353
  • 3
  • 18
  • 36

1 Answers1

0

OAuthException: The access token could not be decrypted

I guess that means you’re passing a value has has been truncated or something (or isn’t an access token at all).

Is your database column holding the access token long enough?

What does a var_dump of $savedAccessToken say?

CBroe
  • 91,630
  • 14
  • 92
  • 150