Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

CONTRIBUTION ez Social Login for Google Facebook LinkedIn Microsoft


stylesoft

Recommended Posts

In your Facebook App Settings, make sure you have a contact email address under "Settings > Basic", then enable your app in "Status & Review"

 

That will get your customers to the facebook authorize screen, but pressing "Okay" displays the following error

 

"Facebook Social Login Error: Social Login was unable to get your email address Please either sign up normally, use another social provider login or re-enable email authorization for this website"

 

This is the string that gets passed back to my site before failing. 

 

login_with_facebook.php?code=AQBIC_5QjXElifxxI0Yl4kWAXBEu30L0AvQa0zCyjWDM6CP-OGcSyt9AL7NiSFDdWh4lQJpcuUnMceXjTBCqYkioyTXHEduYBcK3voLsESkV6aaEKUaaXzSYDTqQUbeGAEIrAvFytnIbobKvMGSKhKCOUWl-eqsZLC1YaOan5xWf53FhEKubdvqAnbEWHK9d3gzFq7LV2CLZw46v2zqOe37aIAcgfn4RPnSKjjx8toP3JWnNWEdNqBbQiVUnzmpxhzDiWaDg94VHOqnGvzDUnVpBT140FRhayXvh9SoXTvmdBtKix6G7VaSCvh36fV0lsR8V4zLuxJfVzvwtFJ1nGxGM&state=1443251028-3599a5#_=_

 

Anyone know how to fix it? All other providers working fine

 

BIG thanks to stylesoft for this great contribution

I get the same thing.... Looks like fb returns some data.  however it doesnt seem to parse properly.  I'm also using https  not http. Has anyone gotten this to work?

Looks like its so close to working...

Link to comment
Share on other sites

  • 4 months later...
  • 1 month later...

@rudolfl

I've been playing with this addon to see if I can make it suitable for Edge and to incorporate some improvements. Not sure where that might end up, but in the meantime go to ezsocial/oauth_client.php and change the line

$this->dialog_url = 'https://www.facebook.com/dialog/oauth?client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}&scope={SCOPE}&state={STATE}';

to

$this->dialog_url = 'https://www.facebook.com/v2.9/dialog/oauth?client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}&scope={SCOPE}&state={STATE}';

You would also need to change at least one line in login_with_facebook.php,

from

if(strlen($client->access_token)) {
                $success = $client->CallAPI(
                    'https://graph.facebook.com/me', 
                    'GET', array(), array('FailOnAccessError'=>true), $user);
            }

to

if(strlen($client->access_token)) {
                $success = $client->CallAPI(
                    'https://graph.facebook.com/me?fields=first_name,last_name',
                    'GET', array(), array('FailOnAccessError'=>true), $user);
            }

to get the user's first name and last name.

osCommerce user since 2003! :thumbsup:

Link to comment
Share on other sites

  • 4 weeks later...

I can use Facebook to register, but whenever I try to login with Facebook I get a message what it couldn't get the email. Someone found any solution? The others works fine.

 

oauth_cliente.php

                $this->oauth_version = '2.9';
                $this->dialog_url = 'https://www.facebook.com/v2.9/dialog/oauth?client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}&scope={SCOPE}&state={STATE}';
                $this->access_token_url = 'https://graph.facebook.com/oauth/access_token';

login_with_facebook.php

    $client->scope = 'email';
    if(($success = $client->Initialize())) {
        if(($success = $client->Process())) {
            if(strlen($client->access_token)) {
                $success = $client->CallAPI(
                    'https://graph.facebook.com/me', 
                     'GET', array('fields'=>'email,first_name,last_name,gender'), array('FailOnAccessError'=>true), $user);
            }

 

Edited by sinopia
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...