12

I have been using Socialite for a few days with Facebook without issue. Today, I started getting this error.

{ "error": 
    { 
       "message": "An active access token must be used to query information 
        about the current user.", "type": "OAuthException",
        "code": 2500, "fbtrace_id": "FTvIz9t1LT+"
   }
}

The error seems straight forward but I can't seem to see a solution online. Is there a way to reset my access_token using Socialite.

Please note: I pretty much followed this tutorial

The error is in the callback when I try and get the

$userProvider try { 
    $userProvider = Socialite::driver('facebook')->user();
} catch (Exception $e) {
   Log::info('Callback Error ' . $e->getMessage());
   return Redirect::to('redirect');
}

Thanks, Rich

osanger
  • 2,276
  • 3
  • 28
  • 35
vc_ace
  • 123
  • 1
  • 4
  • 1
    Not familiar with this API, but most auth tokens in OAuth providers expire, so I think you need a refresh token if this is OAuth 2.0. Without that the user will have to log back in. – Steve Harris Mar 27 '17 at 23:48

3 Answers3

30

This was happening to me also. I fixed it running composer update and then composer dump-autoload. This will update Socialite to v2.0.21

Cheers

Tadeo Rod
  • 574
  • 5
  • 11
  • Hi there, Thanks for the tip but I'm still having the same issue. I verified that composer updated to Socialite to v2.0.21 and cleared every cache I could find but same error message. Did the dump-autoload as well. Were there any other steps you took that may have added to your success? Thanks, Rich – vc_ace Mar 28 '17 at 02:00
  • Thank you! Worked for me too! – mcnamee Mar 28 '17 at 04:02
  • 1
    This worked thank you! But would you mind telling us what really caused the problem? – Kenth John Israel Mar 28 '17 at 12:23
4

It is because v2.2 of Facebook API is no longer available. Update the laravel/socialite package:

composer update laravel/socialite

This way it won't affect your other packages.

flamisz
  • 111
  • 3
2

i think problem is parsing the token so changing this 2 lines should fix the problem

https://github.com/laravel/socialite/pull/214/files#diff-b221dafd8a91f5753288a2d8603cef25

Kekson
  • 53
  • 2
  • 10