Fixing login issue due to Facebook API update 2017

In March 2017 Facebook changed the response format for the Facebook API.
In case you experience issues with Facebook Login button on your Magento website, please download and update your facebook login or social login pro extension.
At Plumrocket, we have released updated versions of free Twitter & Facebook Login extension, as well as Social Login Pro extensions for Magento 1 and Magento 2. Latest versions of these extensions include updated Facebook API response format.

Twitter & Facebook Login Magento Extension

To download latest version of your extension, simply login to your store account and then go to “My Account” => “My Downloads” page. You can also repurchase the extension from our store using links below:

Social Login Pro Magento Extension

To download latest version of your extension, simply login to your store account and then go to “My Account” => “My Downloads” page. You can also repurchase the extension from our store using links below:

Manual code changes

If you wish to update your code manually, please do the following: For Magento 1.x: Navigate to file: app/code/community/Plumrocket/SocialLogin/Model/Facebook.php Find the code:

if($response = $this
    ->_call('https://graph.facebook.com/oauth/access_token', $params)) {  
    parse_str($response, $token); 
}

Replace it with:

if ($response = $this
    ->_call('https://graph.facebook.com/oauth/access_token', $params)) { 
    $token = @json_decode($response, true); if (!$token) { parse_str($response, $token); } 
}

For Magento 2.x: Navigate to one of 2 files: app/code/Plumrocket/SocialLoginPro/Model/Facebook.php app/code/Plumrocket/SocialLoginFree/Model/Facebook.php Find the code:

if($response = $this
    ->_call('https://graph.facebook.com/oauth/access_token', $params)) { 
    parse_str($response, $token); 
}

Replace it with:

if ($response = $this
    ->_call('https://graph.facebook.com/oauth/access_token', $params)) { 
    $token = @json_decode($response, true); if (!$token) { parse_str($response, $token); } 
}
Was this article helpful?