Jump to content
stylesoft

CONTRIBUTION ez Social Login for Google Facebook LinkedIn Microsoft

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...

Share this post


Link to post
Share on other sites

Hi,

 

Current API's (v2.3) is expiring in July. FB suggest moving to 2.9

Are you planning to do so?

Thanks,

Rudolf

Share this post


Link to post
Share on other sites

@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.


Let's make things easier for new osCommerce users http://forums.oscommerce.com/topic/402638-discussion-about-hard-coded-database-tables/?p=1718900  Getting there with osCommerce 2.4! :thumbsup:

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×