How To Configure Magento 2 For Social Login

Person Using Black And White Smartphone and Holding Blue Card

In today’s digital age, social media platforms are an inevitable part of our daily routine. These platforms not only provide us with a platform to socialize but also help us connect with businesses. This is why businesses looking to promote their brand and to engage more with their potential customers are striving to make social media accessible and easy for their users.

Speed Up Your Magento Store by 300%

One step towards that goal is to configure social login into your Magento 2 store. This will allow users to easily sign up and sign in to your store using their social media accounts. In this article, we will guide you through the steps to configure Magento 2 for social login.

To begin with

To start with, you will have to ensure that Magento 2 is already installed on your server. If you are unsure of this, you should consult with your web developer or hosting provider.

Step 1: Create Social Media Apps

The first step is to create social media apps on the platforms you wish to integrate into your Magento 2 store.

Facebook

To create a Facebook app, you can follow these simple steps:

  1. Go to the Facebook Developers website.
  2. Sign up or log in to your Facebook account.
  3. Click on the My Apps button and select Add a New App.
  4. Give your app a name and select the category that applies to your business.
  5. Click on the Create App ID button.
  6. Once your app is created, navigate to the dashboard of the app to obtain your App ID and App Secret.

Google

To create a Google app, follow these steps:

  1. Go to the Google Developers Console.
  2. Sign up or log in to your Google account.
  3. Click on the Create Project button.
  4. Provide the project name and click on the Create button.
  5. Once your project is created, navigate to the APIs & Services -> Credentials section from the sidebar.
  6. Click on the Create Credentials button and select OAuth client ID.
  7. Configure the OAuth consent screen.
  8. Select the Web application type and provide your authorized JavaScript origins and redirect URL.
  9. Click on Create and copy the Client ID and Client Secret.

Step 2: Integrate Social Login Extension

Once you have created the apps on the social media platforms of your choice, you will have to integrate social login extensions to enable the features. There are numerous extensions available for this purpose; you can review and select the one that is most suitable for your business.

One popular extension is the Mageplaza Social Login. To integrate it into your store, follow these steps:

  1. Download the Mageplaza Social Login extension from Magento Marketplace.
  2. Extract the extension zip file and upload it to your Magento 2 store.
  3. Run the following commands in the Magento 2 root directory.
php bin/magento module:enable Mageplaza_Core
php bin/magento module:enable Mageplaza_SocialLogin
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
  1. Navigate to Stores -> Configuration -> Mageplaza -> Social Login from the admin panel.
  2. Provide the necessary App ID and App Secret detail for the social media platforms you wish to enable.
  3. Save the configuration settings.

Step 3: Configure Social Login Buttons

Once you have integrated the extension, you will need to configure the social login buttons. To do so, follow these steps:

  1. Navigate to Content -> Blocks from the admin panel.
  2. Click on the Add New Block button and provide the block title and identifier.
  3. In the Content section, add the following code snippet in the HTML area for each social media platform you wish to enable:

  {{trans "Login with Facebook"}}

  {{trans "Login with Google"}}
  1. Save the content block.

Conclusion

Magento 2 provides a vast array of features to ensure your e-commerce store is fully functional and appealing to users. By integrating social login, you will improve your store’s user experience and enhance your social media presence. The aforementioned steps can be considered to configure your Magento 2 store for social login. It is imperative to regularly evaluate and update your store’s offerings to attract more customers and create an optimal user experience.

Scroll to Top