User Tools

Site Tools


Sidebar

magento_2:social_login

For more details see the Social Login for Magento 2 extension page.

Social Login for Magento 2

Social Login extension significantly fasten the registration process for customers. It improves customers' shopping experience and collect consumers social profile data.

  • AJAX pop-up for the login/register purpose
  • AJAX login pop-up on the cart and checkout pages
  • 3 positions of the social login bar
  • Included reCAPTCHA
  • Supports Twitter, Facebook, Google

Before Configuration

Prior to enabling the Social Login for Magento 2 extension, please make sure that you have installed the additional hybridauth plugin.

Install Hybridauth

To install Hybridauth, you can use Composer.

Add the following entry to the composer.json file in the root of your project.

{
    "require" : {
        "hybridauth/hybridauth" : "~3.0"
    }
}

Via Composer, run a command to install Hybridauth and its dependencies:

$ php composer.phar install

Composer will download the latest version of Hybridauth Library and locate it in the /vendor/ directory.

For more information, check the Hybriduath 3 Documentation.

General Settings

To configure the Social Login for Magento 2 extension, go to Stores → Configuration → Amasty extensions → Social Login and expand the General Settings section.

Enable Social Login - Set to Yes to enable the display of social media buttons, which allows to login via social networks.

If after enabling the extension, you receive the following notification: Additional Social Login package is not installed. Please, run the following command in the SSH: composer require hybridauth/hybridauth, then install the missing plugin.

Add Social Login to - Use multi-select to add social media login to various places on the website.

Available locations:

  • Login Popup
  • Above customer login form
  • Below customer login form
  • Above customer registration form
  • Below customer registration form
  • Shopping cart page

Enable AJAX popup - Set to Yes to enable the AJAX pop-up for the registration and login.

Login Button Position - Choose the place to display social login buttons.

Available positions:

  • Top
  • Bottom
  • Right
  • Left

Redirect after Login - Select the necessary page, where to direct customers after their social login.

  • Stay on the current page
  • To custom URL
  • Refresh Current Page

Google

Enabled - Set to Yes to enable the display of the Google login button.

To create Google+ App, please, go to https://cloud.google.com/console/project.

Click on the CREATE PROJECT button and configure your app settings.

Specify your project name. The project ID will be generated automatically.

Go to the Home → Dashboard tab and press Enable APIs and get credentials like keys in the Getting Started section to set Google APIs settings.

Choose “Google+ API” to set APIs settings.

Press the Enable button to activate Google API in your project.

Go to the Credentials tab and create a client ID to integrate your website with Google+.

Insert your website URL in the required field. In the field Authorized Redirect URLs add /amajaxlogin/google/index/ to your website URL. Then, press the Create button.

Please copy the Client ID and Client Secret, and paste them to the appropriate fields in your backend.

Insert your API KEY (Client ID) and API Secret (Client Secret) in the appropriate fields in the backend and save the configuration.


Facebook

Enabled - Set to Yes to enable the display of the Facebook login button.

To create a Facebook app, go to Facebook Developers

Register as a developer and choose Add New App in the My Apps drop-down.

Choose Facebook Login among the products available for adding.

Specify the Display Name and Contact Email for your app. After that, click the Create App ID button.

Then, go to the Settings → Basic tab to configure your app.

The App ID and App Secret will be generated automatically. Fill in the App Domains field and choose your app category.

Click on the Add Platform button to choose the platform for your social apps.

After clicking on the Add Platform button you’ll see the grid with various platform types. Please select Web.

After specifying the platform type, insert your website URL here and click on the Save Changes button.

Enable the Client OAuth Login and fill in the Valid OAuth redirect URIs on the Facebook Login → Settings tab.

Insert your API Key and API Secret in general extension settings and Save the configuration.

Twitter

Enabled - Set to Yes to enable the display of the Twitter login button.

To create a Twitter App, go to https://apps.twitter.com/.

Click to the Create New App button to create a new Twitter app.

Specify your App name and give a detailed description of the application in App name and Application Description fields. Then, specify your website URL in the Website URL field. In the Callback URLs field specify your website URL and add /amajaxlogin/twitter/ to it.

Go to the Keys and tokens tab and copy the API key and the API secret key.

Specify the necessary access and additional permissions on the Permissions tab.

Insert the API key and the API secret key, obtained from the Keys and tokens tab, to the fields in the backend.

magento_2/social_login.txt · Last modified: 2018/11/14 14:55 by panamarenka