Social Connect Magento extension

In my last article I’ve presented Google Connect Magento extension and your feedback has been nothing but positive. Discussion that followed spawned some new ideas like creating Magento extension that would connect your Magento installation with multiple authentication providers at the same time. Inspired by this idea I wrote another Magento extension named Inchoo Social Connect allowing your customers to login or create an account at your store using their Google, Facebook or Twitter account.
Introduction
After you install and configure Inchoo Social Connect, your Magento installation will have Google, Facebook and Twitter buttons added to your login page as a convenient way for your customers to login or register using their Google or Facebook account. This functionality will also be available at your create an account page, as well as at the first step of your store’s checkout process.
By using one of the Inchoo Social Connect buttons customer will initiate different process depending whether he already connected his user account to one of your store’s accounts or not. For first time customers Social Connect will create a brand new store account using data received from authentication provider, send registration email with store account credentials and then connect that store’s account to authentication provider’s account. If Social Connect discovers that email address given by the authentication provider is already used by existing store customer, customer in question will be logged in and his account will be connected to the authentication provider. Customers who already have their store account connected to an authentication provider’s account will be automatically logged into your store.
To take advantage of Social Connect, existing customers will be able to connect their store accounts with authentication provider of their choice from their account settings page.
There is an exception for first time customers who used Twitter authentication provider to create their store account. Since Twitter doesn’t allow access to user’s email address, these customers will not automatically receive store account credentials. Instead, upon successful registration, affected customers will be instructed to change their email address and store account password, if they wish to use store account credentials to login in the future. Until this action has been taken, like in the case of Google and Facebook, customer will be able to use Twitter button to access his store account.
Please note that this Magento extension has been designed to work with default Magento theme, and if your theme has been heavily modified you might need to tweak Inchoo Social Connect code to use it to it’s full potential. Also note that this extension has been created for Magento Community Edition 1.7.0.2, but I’ll do my best to release promptly updates for future Magento Community Edition versions.
Installation Instructions
First step to having fully functional Social Connect installation is to download latest version of Inchoo Social Connect Magento extension zip package, and merge contents of enclosed directory into your Magento installation root. After adding Social Connect to you Magento installation, you can log into your Magento admin area and go to System -> Configuration -> Customers -> Customers Configuration. If you find tabs named Social Connect Google Options, Social Connect Facebook Options and Social Connect Twitter options there, Inchoo Social Connect has been successfully installed. Before your customers can log into your store using their Google, Facebook or Twitter account, you must provide Inchoo Social Connect with client ID and secret keys for each authentication provider. You can obtain these keys by creating Google Project, Facebook App and Twitter Application using procedure outlined in the following sections.
Creating Google Project
First step to creating Google Project and obtaining Google client ID and secret key is navigating to Google APIs Console. To successfully complete process of creating Google Project you will need following pieces of information:
- Authorized Redirect URIs:
http://www.example.com/socialconnect/google/connect/
- Authorized JavaScript Origins:
http://www.example.com
Don’t forget to replace http://www.example.com
with your store web address. Here’s gallery of screenshots that should securely guide you trough this process:
Creating Facebook App
Creating Facebook App is somewhat similar to creating Google Project. Again, first step is navigating to Facebook Developers page. There you will need following pieces of information:
- Authorized Redirect URIs:
http://www.example.com/socialconnect/facebook/connect/
- Authorized JavaScript Origins:
http://www.example.com
Don’t forget to replace http://www.example.com
with your store web address. Here’s gallery of screenshots to guide you trough this process:
Creating Twitter Application
First step to creating Twitter application is navigating to Twitter Developers page. After clicking at Create a new application button you will be requested to provide following information:
- Callback URL:
http://www.example.com/socialconnect/twitter/connect/
- Website:
http://www.example.com
Don’t forget to replace http://www.example.com
with your store web address. To take advantage of Inchoo Social Connect Twitter related features, you will also need to enable Sign in with Twitter after creating your Twitter Application. Here’s gallery of screenshots to guide you trough this process:
Configuring Social Connect
Client keys and secrets obtained in previous sections are to be placed inside appropriate Social Connect tab input fields accessible at System -> Configuration -> Customers -> Customers Configuration page inside your Magento admin.
Once you click Save Config button Inchoo Social Connect is fully configured and ready to assist your customers with account creation and login process.
Download & Changelog
v0.2.6 (09.12.2013.)
- Translation related fix by Andrei Sena.
- Danish translation CSV by Casper Munk.
- Slovenian translation CSV by Andrej Sluga
v0.2.5 (14.11.2013.)
- Add modman file.
v0.2.4 (30.10.2013.)
- Fix bug where created user was not attached to any web site and confirmation email didn’t have store assigned.
v0.2.3 (15.08.2013.)
- Improve Login, Create an Account and Checkout screens when not all authentication providers are enabled
v0.2.2 (10.08.2013.)
- Fix throwing FacebookOAuthException inside Twitter client
v0.2.1 (02.08.2013.)
- Fix issue where customer is sometimes redirected to wrong location after login
v0.2.0 (29.07.2013.)
- Custom Magento client for Twitter v1.1 API with Twitter OAuth support
- Google, Facebook and Twitter buttons at create an account page
- Brand new design for Google, Facebook and Twitter buttons
- Twitter Connect page at customer account settings
- en_US CSV translation file included
v0.1.0 (04.07.2013.)
- Initial version
- Custom Magento client for Google+ API with Google OAuth2 support
- Custom Magento client for Facebook Graph API with Facebook OAuth2 support
- Google and Facebook buttons at login page
- Google and Facebook buttons at checkout page
- Google Connect and Facebook Connect page at customer account settings
Social Connect Screenshot Gallery
Here’s complete gallery containing screenshots relevant to Inchoo Social Connect functionality:
Where to go next?
Developers amongst you will most probably want to review the code, in this case I recommend visiting Inchoo Social Connect GitHub repository page. On the other hand if you have questions or encounter difficulties while using Inchoo Social Connect extension for Magento, feel free to contact us. We would be happy to help with our Magento Development skills or by checking out your site and creating a detailed, customized report based on our Magento Technical Audit.
397 comments
Using Magento 1.9.2.4 on php 7.x
Wont install, get this message:
CONNECT ERROR: Package file is invalid
Invalid package name, allowed: [a-zA-Z0-9_-] chars
Invalid version, should be like: x.x.x
Invalid stability
Invalid date, should be YYYY-DD-MM
Invalid channel URL
Empty authors section
Empty package contents section
How to display fb and google plus socail login in popup.
this plugin is not working anymore, getting error in facebook login and google login as well
Have resolve this issue?
I am facing the same issue.
Hi Marko,
getting 404-page issue after a redirect from google can you suggest anything
https://www.fabrento.com/delhi/socialconnect/google/connect/?state=4dbeb8d44c4ffd80bdcc63e2a18be4a7&code=4/ZgDEOvE0i6yHcm1WDuUKsPgEymSnW9XS5MFi5chgxUYPu944F6csSYmageGggknyZc3Znx_NfE8xfB9P6Lje1TE&scope=https://www.googleapis.com/auth/userinfo.profile%20https://www.googleapis.com/auth/userinfo.email
Thanks in advance
Hi, were you able to find the solution? I am also getting this 403 Forbidden error on same step.
hi, the plugin is working fine for me in google login, but the facebook login is giving me an error as it redirect to graph.facebook.com/aurtourize/*****, how can i change it to facebook.com as in tutorial it redirect to facebook.com/dialog/***,
Hello there,
‘customer_register_success’ event is not working from this module.can you please suggest edit file?
hi,
I have installed the plugin and the google login is working fine but the customer registration form is not working properly.when a customer register himself it is submitting the page and again the same page is loaded with creating an account.how to resolve it?
Hi,
I want to implement it in my popup box. does it will work
For Example – FB https://graph.facebook.com/oauth/authorize?client_id=xxxxx&redirect_uri=http%3A%2F%2Fxxxxxxx.com%2Fsocialconnect%2Ffacebook%2Fconnect%2F&state=995a3fb9086599bc469be725d314a2fe&scope=email%2Cuser_birthday
hi im using your plugin but i encountered a “Error: redirect_uri_mismatch” can you help with this?
hii inchoo team,
I added inchoo social login extension in my Magento project. below is URL of my project.
https://www.tecknormous.co.uk/customer/account/login/
when I was login through facebook. the error has come. so please give me guidance regarding this error.
Hi everyone!
We have an issue on Magento 1.9.3.2. After someone successfully created an account, while accessing the Facebook Connect from the customer admin interface (http://www.*developmentdomain*.com/socialconnect/account/facebook/ we get an error:
There has been an error processing your request
No token set, nothing to extend.
Trace:
#0 /home/***developmentdomain***.com/public_html/app/code/community/Inchoo/SocialConnect/Model/Facebook/Oauth2/Client.php(92): Inchoo_SocialConnect_Model_Facebook_Oauth2_Client->extendAccessToken()
#1 /home/***developmentdomain***.com/public_html/app/code/community/Inchoo/SocialConnect/Model/Facebook/Info.php(60): Inchoo_SocialConnect_Model_Facebook_Oauth2_Client->setAccessToken(NULL)
#2 /home/***developmentdomain***.com/public_html/app/code/community/Inchoo/SocialConnect/Model/Facebook/Info/User.php(49): Inchoo_SocialConnect_Model_Facebook_Info->setAccessToken(NULL)
#3 /home/***developmentdomain***.com/public_html/app/code/community/Inchoo/SocialConnect/controllers/AccountController.php(52): Inchoo_SocialConnect_Model_Facebook_Info_User->load()
#4 /home/***developmentdomain***.com/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Inchoo_SocialConnect_AccountController->facebookAction()
#5 /home/***developmentdomain***.com/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch(‘facebook’)
#6 /home/***developmentdomain***.com/public_html/app/code/community/ArtsOnIT/OfflineMaintenance/Controller/Router/Standard.php(46): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#7 /home/***developmentdomain***.com/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): ArtsOnIT_OfflineMaintenance_Controller_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 /home/***developmentdomain***.com/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#9 /home/***developmentdomain***.com/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#10 /home/***developmentdomain***.com/public_html/index.php(85): Mage::run(”, ‘store’)
#11 {main}
Unfortunately I am not a developer, and got stuck here. Any hints or tips?
Thanks for your magento extension information it’s very helpful blog.
Can we get user profile images in the extension? anybody have any idea?
I wasn’t able to login after putting all the API’s
but after debugging code i found that.
in google Controller
$state = $this->getRequest()->getParam(‘state’);
and
Mage::getSingleton(‘core/session’)->getGoogleCsrf();
are different so when it comes to below statement it just return from there without rendering code further from there.
protected function _connectCallback() {
$state = $this->getRequest()->getParam(‘state’);
if(!$state || $state != Mage::getSingleton(‘core/session’)->getGoogleCsrf()) {
return;
}
}
someday ago everything was working perfect but now it’s showing those different values for that..
i don’t want to remove that Or check from there, so is there any way to solve this problem or resetting the google session object
Hi Karan,
I have faced same problem before few day ago, I have researched for this and finally i have got solution, that is due to login page ajax request call many times after login page load successfully like “http://example.com/customer/account/login/null”, you can checked on console, on may case it’s due to lazyload that many time call the login page request by ajax after page load successfully, if you have resolved this error your problem can easily solve.
Thanks,
Kinjal
I have got the same issue, how did you solve it? I am facing it both in google and facebook.
Hi thanks for this plugin, But i m getting error while login through this plugin, please have a look at the stack trace:
: Uncaught TypeError: Argument 1 passed to Mage_Sales_Model_Quote::setCustomer() must be an instance of Mage_Customer_Model_Customer, null given, called in /var/www/html/plantlane/app/code/core/Mage/Checkout/Model/Session.php on line 166 and defined in /var/www/html/plantlane/app/code/core/Mage/Sales/Model/Quote.php:453
Stack trace:
#0 /var/www/html/app/code/core/Mage/Checkout/Model/Session.php(166): Mage_Sales_Model_Quote->setCustomer(NULL)
#1 /var/www/html/app/code/core/Mage/Checkout/Model/Cart.php(119): Mage_Checkout_Model_Session->getQuote()
#2 /var/www/html/app/code/core/Mage/Checkout/Model/Cart.php(546): Mage_Checkout_Model_Cart->getQuote()
#3 /var/www/html/app/code/core/Mage/Checkout/Model/Cart.php(521): Mage_Checkout_Model_Cart->getItemsQty()
#4 /var/www/html/app/code/core/Mage/Checkout/Block/Cart/Minicart.php(47): Mage_Checkout_Model_Cart->getSummaryQty()
#5 /var/www/html/app/design/frontend/accessshop/default/template/checkout/cart/topcart.ph in /var/www/html/plantlane/app/code/core/Mage/Sales/Model/Quote.php on Line 453
This plugin is working, but to login FB social login it’ss asking for birthday??? I suppose it’s sensitive user data and if I would choose on FB (because it requires app review) : Determines whether people are under 18, over 18 or over 21 ; then I must provide to facebook (review staff) the link where we collect this data; But on our store/user profile we don’t collect birthday date and I believe it’s needed to remove it from this extension and to leave only email address collection from facebook.
Hi Marko,
I am using your extension “Social Login” . It works great. But when I trying to customize it to render the login button in modal window and also there will be login default magento page with social login , if customer comes directly to login page after getting welcome email or forgot password.
When I did the customization, I am not able to login. After click the button it redirects to login default magento page. It seems when I call button blocks twice, one in modal window and other in login default magento page, the extension breaks. When I disable any one of the button blocks, it works as it was.
Please help me to resolve this issue.
Thanks,
VMT
Array
(
[type] => 2
[message] => vsprintf(): Too few arguments
[file] => /home/thrilcpi/public_html/app/code/core/Mage/Core/Model/Translate.php
[line] => 416
)
getting this error after installing this extension…wrked fine innitially but now after every new registration…it shows above error….
Hi..I want place these all button below the create account button where i want to change.
Even 3 years old, this extention still helped me greatly to implement my own Social-Connect module.
I started off using Inchoo’s but made so many adjustments in the end (most of them for “style” issues rather than functionality issues), that I decided to write my own from scratch. For everyone who wants to use Inchoo’s extention today, two things I remember that could help making it work more smoothly:
Facebook API
Like Santiago Glez already mentioned, https://graph.facebook.com/(v2.8/)me now expects field parameters. For that reason I changeed the $client->api call in FacebookController.php (within _connectCallback()) to:
(I was saving the $fallbackEmail to check at the function’s end if an address could be retrieved or whether the old standard notification about being unable to the address was necessary.)
I don’t remember encountering any issues with the Google API.