thejudge99 Posted July 26, 2012 Share Posted July 26, 2012 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 Quote Link to comment Share on other sites More sharing options...
thejudge99 Posted July 26, 2012 Author Share Posted July 26, 2012 (edited) download link http://addons.oscommerce.com/info/8509 Demo http://ocraw.conzept.de/login.php Edited July 26, 2012 by thejudge99 Quote Link to comment Share on other sites More sharing options...
thejudge99 Posted July 26, 2012 Author Share Posted July 26, 2012 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 Quote Link to comment Share on other sites More sharing options...
Guest Posted July 26, 2012 Share Posted July 26, 2012 NICE.. BUT SOMETIMES LOG ME IN, SOMETIMES DONT, DONT LOG ME OUT... MAYBE IM DOING SOMETHING WRONG IN YOUR SITE. Quote Link to comment Share on other sites More sharing options...
thejudge99 Posted July 27, 2012 Author Share Posted July 27, 2012 log out will log you out of oscommerce - not facebook or google - ie once logged in - oscomemrce handles everything thereafter. Quote Link to comment Share on other sites More sharing options...
fotogaaf Posted July 27, 2012 Share Posted July 27, 2012 nice.......I will wait to install to see if issues arise! Quote Link to comment Share on other sites More sharing options...
breeaakdancc Posted July 29, 2012 Share Posted July 29, 2012 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 Quote Link to comment Share on other sites More sharing options...
thejudge99 Posted July 29, 2012 Author Share Posted July 29, 2012 (edited) 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 July 29, 2012 by thejudge99 Quote Link to comment Share on other sites More sharing options...
sunrise99 Posted August 4, 2012 Share Posted August 4, 2012 (edited) Many thanks for your best solution. But i get this error, would you please help to suggest asap? Thanks & Best Regards, Sunrise99 Edited August 4, 2012 by sunrise99 Quote Link to comment Share on other sites More sharing options...
thejudge99 Posted August 4, 2012 Author Share Posted August 4, 2012 (edited) <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 August 4, 2012 by thejudge99 Quote Link to comment Share on other sites More sharing options...
thejudge99 Posted August 4, 2012 Author Share Posted August 4, 2012 and obviously delete the 2 lines after testing Jules Quote Link to comment Share on other sites More sharing options...
thejudge99 Posted August 4, 2012 Author Share Posted August 4, 2012 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 Quote Link to comment Share on other sites More sharing options...
sunrise99 Posted August 10, 2012 Share Posted August 10, 2012 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. Quote Link to comment Share on other sites More sharing options...
thejudge99 Posted August 10, 2012 Author Share Posted August 10, 2012 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. Quote Link to comment Share on other sites More sharing options...
thejudge99 Posted August 10, 2012 Author Share Posted August 10, 2012 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 Quote Link to comment Share on other sites More sharing options...
sunrise99 Posted August 13, 2012 Share Posted August 13, 2012 (edited) 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. Edited August 13, 2012 by sunrise99 Quote Link to comment Share on other sites More sharing options...
thejudge99 Posted August 14, 2012 Author Share Posted August 14, 2012 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 Quote Link to comment Share on other sites More sharing options...
sunrise99 Posted August 19, 2012 Share Posted August 19, 2012 (edited) 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. Edited August 19, 2012 by sunrise99 Quote Link to comment Share on other sites More sharing options...
thejudge99 Posted August 19, 2012 Author Share Posted August 19, 2012 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 Quote Link to comment Share on other sites More sharing options...
thejudge99 Posted August 19, 2012 Author Share Posted August 19, 2012 This is a screenshot of my app for my demo oscommerce site. Quote Link to comment Share on other sites More sharing options...
thejudge99 Posted August 19, 2012 Author Share Posted August 19, 2012 it seems you are using www try http://www.ovizun.com as the Site URL Quote Link to comment Share on other sites More sharing options...
sunrise99 Posted August 20, 2012 Share Posted August 20, 2012 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, Quote Link to comment Share on other sites More sharing options...
Guest Posted August 24, 2012 Share Posted August 24, 2012 (edited) 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 August 24, 2012 by CrazyCarzCustoms Quote Link to comment Share on other sites More sharing options...
Guest Posted August 24, 2012 Share Posted August 24, 2012 Maybe this is important; No idea what it means but it also tells this: Description of the request, response_type=code scope=https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email redirect_uri=REDIRECT_URL access_type=offline approval_prompt=force client_id=CLIENT_ID Gr, Rob Quote Link to comment Share on other sites More sharing options...
thejudge99 Posted August 24, 2012 Author Share Posted August 24, 2012 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.