Jump to content
thejudge99

CONTRIBUTION Social Login with Facebook / Google 2.3.1/2

Recommended Posts

Social login with facebook / google support thread

 

Ive written a Login module - one that doesnt first pass customer infomation on to a third party .

 

Using

 

Facebook 3.1.1 OAuth 2.0

Google Oauth 2.0

 

The scripts will automatically log existing customers ( providing email + first + lastname are the same)

or automatically sign up new customers.

 

Someone attempting to signup / login with an existing email that has different first / last names will fail.

 

Contribution link comes soon

Share this post


Link to post
Share on other sites

yes that means youve no date of birth given in your google account ( birthday is a recent addition to google plus) and the script is adhering to my default oscommerce settings - ie DOB is required

Share this post


Link to post
Share on other sites

NICE.. BUT SOMETIMES LOG ME IN, SOMETIMES DONT, DONT LOG ME OUT... MAYBE IM DOING SOMETHING WRONG IN YOUR SITE.

Share this post


Link to post
Share on other sites

Can you please help me?

 

I get an error if I click on the FB-Login Panel. :

 

 

Fatal error: Uncaught exception 'Exception' with message 'Facebook needs the CURL PHP extension.' in /data/multiserv/users/150860/projects/2136783/www/catalog/includes/classes/base_facebook.php:19 Stack trace: #0 /data/multiserv/users/150860/projects/2136783/www/catalog/includes/classes/facebook.php(17): require_once() #1 /data/multiserv/users/150860/projects/2136783/www/catalog/includes/login-facebook.php(3): require('/data/multiserv...') #2 /data/multiserv/users/150860/projects/2136783/www/catalog/login.php(28): require('/data/multiserv...') #3 {main} thrown in /data/multiserv/users/150860/projects/2136783/www/catalog/includes/classes/base_facebook.php on line 19

 

can you help me? :S

Share this post


Link to post
Share on other sites

you dont have the CURL php extension - both facebook and google need it.

 

PS. facebook.php and base_facebook.php are part of facebook API and are not coded by me

Edited by thejudge99

Share this post


Link to post
Share on other sites

Many thanks for your best solution.

 

But i get this error, would you please help to suggest asap?

 

Thanks & Best Regards,

Sunrise99

post-186794-0-41857600-1344048620_thumb.jpg

Edited by sunrise99

Share this post


Link to post
Share on other sites

<p>when you set up the facebook Website with Facebook Login ( 5) did you enter a valid domain?

 

if you are using SSL you must enter https://MY_DOMAIN.COM or http://MY_DOMAIN.COM if you are not using SSL.

 

This Domain should be identical to whats passed to facebook as a redirect URL.

 

To test open

 

inludes/login-facebook.php

 

find (near the bottom)

 

$loginUrl   = $facebook->getLoginUrl($params); // generate the url and redirect the browser to it

 

insert above

 

echo tep_href_link(FILENAME_LOGIN, 'oauth_provider=facebook', 'SSL');
exit();

 

this will return something like

http (s) ://MY_DOMAIN.COM/login.php?oauth_provider=facebook

Edited by thejudge99

Share this post


Link to post
Share on other sites

Added a small update which performs other things that should happen during a login.

 

E.g Wishlist contribution needs to reload the wishlist as well as the cart.

 

open

 

inludes/login-facebook.php
googleloader.php

 

find ( in Both )

 

$cart->restore_contents();

 

add below

 

// restore wishlist to sesssion
$wishList->restore_wishlist();
// here continue with anything else that needs doing after a successfull login

 

Followed by anything else that should happen after a successful login

 

The new login package contains this same information - so no need to post a new link

 

Jules

Share this post


Link to post
Share on other sites

and obviously delete the 2 lines after testing

 

Jules

 

Thanks for your suggestion.

I add them and can get it:

 

this will return something like

 

http (s) ://MY_DOMAIN.COM/login.php?oauth_provider=facebook

 

 

But I still can't login using FB.

Share this post


Link to post
Share on other sites

If facebook is throwing an error before you can even choose to allow access then you have wrong data setup - which can only be a domain mismatch.

Share this post


Link to post
Share on other sites

taking 1 step back.

 

make sure that you have

 

1) Created your facebook app

2) Got a set of keys

3) Inserted said keys into includes/fbconfig.php

 

after that is ok can you look to make sure domain is correct

Share this post


Link to post
Share on other sites

taking 1 step back.

 

make sure that you have

 

1) Created your facebook app

2) Got a set of keys

3) Inserted said keys into includes/fbconfig.php

 

after that is ok can you look to make sure domain is correct

 

Dears,

Would you please help to give some suggestion?

 

we are not using login button at root domain. we put our fb login button at: www.mydomainname.com/anotherdirectory.php

 

Please kindly see the attached FB setting.

post-186794-0-20225200-1344868480_thumb.jpg

Edited by sunrise99

Share this post


Link to post
Share on other sites

Remove the Hosting URL

Remove the App Domains

 

and for Site URL enter ONLY the domain http://ovizun.com

no trailing slash at the end - no actual page - ONLY THE DOMAIN ( as per my given instructions )

 

If you are using that for other things as well which requires the other setting filled out then create a new app specifically for logging in.

 

Jules

Share this post


Link to post
Share on other sites

Remove the Hosting URL

Remove the App Domains

 

and for Site URL enter ONLY the domain http://ovizun.com

no trailing slash at the end - no actual page - ONLY THE DOMAIN ( as per my given instructions )

 

If you are using that for other things as well which requires the other setting filled out then create a new app specifically for logging in.

 

Jules

 

Many thanks for your suggestion. We create one new ID and update code. still can't login it.

 

Please see our new setting on FB.

post-186794-0-63636800-1345348151_thumb.jpg

Edited by sunrise99

Share this post


Link to post
Share on other sites

By new ID i assume you mean a new app ? you then updated includes/fbconfig.php with the new keys ? otherwise it will still try and connect to the old 1.

 

Jules

Share this post


Link to post
Share on other sites

it seems you are using www

 

try

 

http://www.ovizun.com as the Site URL

 

Thanks for your help. Yes. I updated includes/fbconfig.php with the new keys , I will update to www. and test now.

 

 

Best Regards,

Share this post


Link to post
Share on other sites

hi,

 

I have installed this app and all went fine , it logs in with the FB button but with Google it tells this :

 

Invalid parameter value for redirect_uri: Missing scheme: REDIRECT_URL

 

I have checked the url on Google and in my config.php and they both are the same.

 

What am i missing here?

 

Thanks in advance,

 

Rob

 

 

 

 

reason for edit: it´s friday and i can´t type

Edited by CrazyCarzCustoms

Share this post


Link to post
Share on other sites

Maybe this is important;

 

No idea what it means but it also tells this:

 

Description of the request,

 

 

 

Gr, Rob

Share this post


Link to post
Share on other sites

You have a redirect url mismatch - similar to what sunrise has with his facebook app - double check your google app settings - if still no joy post your settings here and ill try to help.

 

Basic things to check for both is.

 

1 ) using www or without - for the apps http://www.somedomain.com is NOT THE SAME as http://somedomain.com

2) Likewise https://somedomain.com is not the same as http://somedomain.com basically if you have an SSL certificate then your customers when logging in will be using login.php WITH HTTPS . This means the redirect urls or website urls must also be with HTTPS.

 

My redirect URL( on my test site ) for google is http://ocraw.conzept.de/googleloader.php no https because i dont use SSL.

 

Jules

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

×