The session was invalidated because the user changed the password & # 8594; password has not been changed

Dear Stapokver! Dear Facebook Developers!

I created a Facebook app a couple of weeks ago. During this time, it worked perfectly. My PHP-Script checks if access_token has at least 10 days before the expiration date (it automatically sets a long expiration date before it), and if so (if> = the expiration date is 10), it tries to get a new access_token for the same user (who me, me and me).

The problem is that from yesterday it causes an error:

Fatal error: Uncaught OAuthException: Error validating access token: The session has been invalidated because the user has changed the password. 

Now my question is: how can he do this, since I have never changed my password to FB ???

Does anyone have a hint for me in the right direction to solve this problem? I would really appreciate any help.

Yours faithfully,

Aceline

+7
passwords oauth facebook-graph-api
source share
1 answer

There is really nothing wrong with your thread. This actually throws this error when the token has expired.

We have such an error before and what we did, we regularly checked that the accessToken remains valid, if it is not later, we generate and save a new one. However, when we set the accessToken to be used, we will also extend the token before it is stored in the local database. See extendedAccessToken

Here is an update example (This is just rough code):

 // Set the access token and extend it $facebookClient = new FacebookClient(); $facebookClient->setAccessToken($accessToken); $facebookClient->setExtendedAccessToken(); // Query your user that will have the updated access token and update it. $user = User::get($userId); $user->accessToken = $facebookClient->getAccessToken(); $user->update(); 
0
source share

All Articles