Social Login

 

What is the Social Login module?

Social Login provides online shoppers with quick registration and authorization possibilities through social login buttons. A social login block can be added to login, register, cart, and checkout pages of a website. Add up to nine login options. Place a social login block in custom page positions as a widget. Define the display order of login options individually on each page. View all the linked social accounts from a single table. 

 

How do I Configure Social Networks?

Twitter

1. Create an account on Twitter

If you are new to Twitter, first, you will need to create an account.

The account is registered with the email address. Make sure to fill in all the fields and follow the registration steps provided by Twitter.

Create an account on Twitter | Social Login by Aheadworks eCommerce Cloud

2. Register a Twitter application

In August 2020, Twitter introduced the concept of a Twitter project, a new way to organize your Twitter apps and to provide access to the v2 version of the Twitter APIs. If you haven't logged on to Twitter’s Developer Portal since August 1, 2020, you’ll likely see a dialog box similar to this one the next time do log on:

Twitter apply | Social Login by Aheadworks eCommerce Cloud

If you want to create a Twitter project, you must first apply for a Twitter development account; that process consists of answering a few questions about what your project/app is intended to do and what type of user data you want to access. Depending on your answers to these questions, your application could be approved immediately, or you might have to wait a few days for Twitter to make a decision.

That said, however, you don’t necessarily need to apply for a developer account nor do you need to create a project in order to use Twitter for social login. Any apps you created prior to August 2020 will still be available to you: you can still manage those apps and still use them for social logins . However, you will not be able to create new apps without a developer account. 

Creating a Twitter Project and a Social Login App

Assuming your developer account is approved, the next time you log on to the Twitter Developer Portal your Dashboard will look similar to this:

Twitter dashboard | Social Login by Aheadworks eCommerce Cloud

In other words, you’ ll have a default project (Project 1) but not apps. Your first course of action is to add an app to that project.

To create an app, click Add App to display the Add your App page:

Add your app | Social Login by Aheadworks eCommerce Cloud

If you prefer, you can click the Choose App dropdown list and add one of your existing apps to your new project. For this example, however, we’ ll click Create a new App instead. When the Name your App page appears, type a unique name (unique across all of Twitter) for your app in the App name field and then click Complete:

Name your app | Social Login by Aheadworks eCommerce Cloud

That creates your new app and displays the default app details:

App details | Social Login by Aheadworks eCommerce Cloud

In order to use your new Twitter app for social logins you must next enable 3rd party authentication. To do that, locate the Authentication settings section and complete the following procedure:

1. Click Edit.

2. When the authentication settings appear, select Enable 3rd party authentication:

Edit authentication settings | Social Login by Aheadworks eCommerce Cloud

3. If you want to return a user’s email address after that yes has logged on, select Request email address from users:

Request email address from users | Social Login by Aheadworks eCommerce Cloud

Note that this is optional; you can use Twitter for social login without returning the user’ s email address.
4. Enter your callback URI in the Callback URLs field, and enter the URL of your website in the Website URL field:

Callback URLs and Website URL | Social Login by Aheasworks eCommerce Cloud

Starting from March 2018, all OAuth apps require a Valid OAuth redirect URIs list. Thus, each OAuth app redirect will be accepted only for URIs included in the list.

For example, if https://greg-stemp.rpxnow.com/facebook/callback is the only URI in the list, then redirects to https://greg-stemp.rpxnow.com/facebook/callback/tokens or https://greg-stemp.rpxnow.com/facebook/callback/redirects will no longer be allowed.

If your app references a URI that is not in the list, the login attempt will fail.

This way, when creating a new key, your Valid OAuth redirect URI must have the following format:

https://[Your domain name]/social/account/callback/provider/twitter/

Your callback URI will typically be your social login URL

5. If you are returning user email addresses in your social login response then you must enter the URL to your terms of service in the Terms of service field, and the URL to your privacy policy in the Privacy policy field:

Terms of service and Privacy policy | Social Login by Aheadworks eCommerce Cloud

If you didn't enable the Request email address from the users setting then you can leave these two fields blank.
6. Click Save to save your new app. 

3. Get the API Key and Secret

1. To retrieve this information, click Keys and tokens:

Get API key and secret | Social Login by Aheadworks eCommerce Cloud

2. On the Consumer Keys page, click View Keys:

Consumer Keys | Social Login by Aheadworks eCommerce Cloud

3. In the Here are your API key and secret dialog box, click the Copy button (the + sign) located to the right of your API key and then paste the copied API key into a secure location (such as password management program). Repeat this process to copy the API key secret:

API keys and secrets | Social Login by Aheadworks eCommerce Cloud

4. When done, click Yes, I saved them to dismiss the dialog box. At that point, you can log off from the Twitter Developer Portal.

5. Navigate to Stores > Configuration > Aheadworks Ecommerce > Social Login;

6. Paste the Consumer Key and Secret into the appropriate fields of the Twitter configuration section.

That's it. Once enabled, the corresponding Twitter button will appear in the set social login block of your store.

Facebook

    1. Register as a Facebook Developer

    2. Create an App

    3. Set-up the Facebook Login product

3.1 Go to the Apps Panel, the App Dashboard's entry point. Navigate to Facebook Login and press the Set up button.

Facebook creating an account | Social Login by Aheadworks eCommerce Cloud

3.2 Select Web from the displayed platforms

Creating an account | Social Login by Aheadworks eCommerce Cloud

3.3 Go to the Settings section and choose Basic.

3.4 In the appeared menu some of the fields are generated automatically. All you need to do is fill in the rest of them, such as App Domains and Contact Email in particular. Please note these two are obligatory options. Privacy Policy URL and Terms of Service URL are optional, but we recommend you NOT to leave them blank. You will not be able to switch your application to live mode without them being set.

3.5 Once you've filled all the necessary fields, press the Add Platform button to move to the next step.

Adding platform | Social Login by Ahedworks eCommerce Cloud

3.6  Select the Website from the list.

Website configurations | Social Login by Aheadworks eCommerce Cloud

3.7 Set the website URL address in the Site URL field and press the Save Changes button.Website URL adress | Social Login by Aheadworks eCommerce Cloud

3.8 Navigate to App Review and press Permissions and Features. Make sure all relevant permissions are requested (public_profile and email, for example)

Permissions and Features | Social Login by Aheadworks eCommerce Cloud

3.8 Navigate to Facebook Login section and press Settings.

3.9 Enter you Valid OAuth Redirect URLs. It differs depending on the software you are using it for. Usually, you can get  OAuth Redirect URL in the software settings info. Make sure the Use Strict Mode for Redirect URls option is set to YesWeb OAth Login is set to Yes, Enforce HTTPSoption is enabled and check that the section "Deauthorize / Deauthorize Callback URL" is empty.

Starting from March 2018, all OAuth apps require a Valid OAuth redirect URIs list. Thus, each OAuth app redirect will be accepted only for URIs included in the list.

For example, if https://greg-stemp.rpxnow.com/facebook/callback is the only URI in the list, then redirects to https://greg-stemp.rpxnow.com/facebook/callback/tokens or https://greg-stemp.rpxnow.com/facebook/callback/redirects will no longer be allowed.

If your app references a URI that is not in the list, the login attempt will fail.

This way, when creating a new key on the Facebook app, your Valid OAuth redirect URI must have the following format:

https://[Your domain name]/social/account/callback/provider/facebook

3.10 Press the Save Changes button.

Saving changes | Social Login by Aheadworks eCommerce Cloud

3.11 Once you've saved all the changes  Switch your Facebook APP to Live Mode.

Facebook app go live | Social Login by Aheadworks eCommerce Cloud

  4. Get the API Key and Secret

Go to Settings > Basic. Here you can find the App ID and App Secret.

Facebook app go live | Social Login by Aheadworks eCommerce Cloud

Navigate to Stores > Configuration > Aheadworks Ecommerce > Social Login. Paste the Consumer Key and Secret into the appropriate fields of the Facebook configuration section.

Instagram 

Since Instagram is now managed by Facebook, it is recommended you use the Facebook Login product as an authentication solution. 

Google 

1. Create an account with Google

Creating an account with Google | Social Login by Aheadworks eCommerce Cloud

If you are new to Google, you will first need to create an account.

Make sure to fill in all the fields and follow the registration steps provided by Google.

2. Create/Select a Google project

2.1 Go to the Google Developers Console.

2.2 Click the project drop-down and select or create the project for which you want to add an API key.

Google developers console | Social Login by Aheadworks eCommerce Cloud

To create a new project, click on the New Project button in the top right. To use the existing project, click on the name of the project on the list.

Google developers console | Social Login by Aheadworks eCommerce Cloud

2.3 Go to the menu on the left and select APIs & Services > Credentials.

Google APIs and Services | Social Login by Aheadworks eCommerce Cloud

2.5 On the Credentials page, click + Create Credentials > API key or use the API from the list.

Google APIs and Services | Social Login by Aheadworks eCommerce Cloud

When a new API is created, the API key created dialog displays the newly created API key.

API key Google | Social Login by Aheadworks eCommerce Cloud

2.6 Click Close. The new API key is listed on the Credentials page under API Keys.
Remember to restrict the API key before using it in production. Restricting API Keys adds security to your application by ensuring only authorized requests are made with your API Key.

3. Set up OAuth2.0

To use OAuth 2.0 in your application, you need an OAuth 2.0 client ID, which your application uses when requesting an OAuth 2.0 access token.

To create an OAuth 2.0 client ID in the console:

1. Go to the Google Cloud Platform Console > APIs & services > Credentials

2. Click + Credentials, then select OAuth client ID. If you're unsure whether OAuth 2.0 is appropriate for your project, select Help me choose and follow the instructions to pick the right credentials.

OAuth client ID | Social Login by Aheadworks eCommerce Cloud

Select Web Application and enter the name for the app. 

Web application | Social Login by Aheadworks eCommerce Cloud

3. Scroll down to Authorized redirect URIs and enter http://yourdomain.com/social/account/callback/provider/google/, where yourdomain.com is the name of your domain where social login is meant to be used.

Starting from March 2018, all OAuth apps require a Valid OAuth redirect URIs list. Thus, each OAuth app redirect will be accepted only for URIs included in the list.

For example, if https://greg-stemp.rpxnow.com/facebook/callback is the only URI in the list, then redirects to https://greg-stemp.rpxnow.com/facebook/callback/tokens or https://greg-stemp.rpxnow.com/facebook/callback/redirects will no longer be allowed.

If your app references a URI that is not in the list, the login attempt will fail.

This way, when creating a new key, your input must have the following format:

https://[Your domain name]/social/account/callback/provider/google

4. Click Create

Authorized redirect URLs | Social Login by Aheadworks eCommerce Cloud

5. Configure Consent Screen

creating oauth client | Social Login by Aheadworks eCommerce Cloud

If this is your first time creating a client ID, you can also configure your consent screen by clicking Consent Screen. You will be prompted to do so on clicking the Create button. You won't be prompted to configure the consent screen after you do it the first time.

The following procedure from the native Google Cloud Platform Console Help explains how to set up the Consent screen.

6. Get the API Key and Secret

Go to the Google Cloud Platform Console > APIs & services > Credentials, choose an OAuth 2.0 Client IDs entry and click on the Edit icon.

Google cloud platform console | Social Login by Aheadworks eCommerce Cloud

Copy the Client Key and Secret.

Google cloud platform console | Social Login by Aheadworks eCommerce Cloud

Navigate to Stores > Configuration > Aheadworks Ecommerce > Social Login. Paste the Client ID into the 'Consumer Key' field and the Client Secret into the 'Consumer Secret' field of the Google configuration section.

LinkedIn

1. Create an account on LinkedIn

Creating an account on LinkedIn | Social Login by Aheadworks eCommerce Cloud

If you are new to LinkedIn, you will first need to create an account.

The account is registered with your email address. Make sure to fill in all the fields and follow the registration steps provided by LinkedIn.

2. Register a LinkedIn application

On the LinkedIn Developers page, click the Create App button in the top right.

Fill in all the Create an app form

Creating an account on LinkedIn | Social Login by Aheadworks eCommerce Cloud

Tick the I have read and agree to these terms check-box, and click Create App below. The application is created. You are now redirected to the profile page of the application. 

Go to the Products tab and click on the Select button within the Sign In with LinkedIn block. A popup will emerge, prompting to accept the Legal Agreement and confirm your choice of the product. Accept the Agreement and add the product. Your application for the product will be placed under review. 

Creating an account on LinkedIn | Social Login by Aheadworks eCommerce Cloud

3. Get the API Key and Secret

When on the profile page of the application, select the  'Auth' tab. Scroll down to the OAuth 2.0 settings and suggest the URL of your home-page.

Paste the homepage URL of your store into the 'Authorized Redirect URLs for your app' text-box

OAuth 2.0 settings | Social Login by Aheadworks eCommerce Cloud

Make sure that only https URLs will work here for LinkedIn.

Scroll up the page to find the Authentication keys.

  • Copy the Client ID and Client Secret;
  • Navigate to Stores > Configuration > Aheadworks Ecommerce > Social Login;
  • Paste the Client ID into the 'Consumer Key' field and the Client Secret into the 'Consumer Secret' field of the LinkedIn configuration section.

OAuth 2.0 settings | Social Login by Aheadworks eCommerce Cloud

That is it. Once enabled, the corresponding LinkedIn button will appear in the set social login block of your store.

Odnoklassniki

1. Create an account on Odnoklassniki

Create an account on Odnoklassniki | Social Login by Aheadworks eCommerce Cloud

If you are new to Odnoklassniki, you will first need to create an account.

The account is registered with a phone number. Make sure to fill in all the fields and follow the registration steps provided by Odnoklassniki.

2. Register an Odnoklassniki application

On your Odnoklassniki page, navigate to Games.

Create an account on Odnoklassniki | Social Login by Aheadworks eCommerce Cloud

Click My uploads in the left navigation menu and then click Add App.

Create an account on Odnoklassniki | Social Login by Aheadworks eCommerce Cloud

On the 'App settings' page, enter the app's title and click on the Enable OAuth button.

Create an account on Odnoklassniki | Social Login by Aheadworks eCommerce Cloud

Paste the homepage URL of your store and the /social/account/callback/provider/odnoklassniki/ path right after to the 'List of permitted redirect_uro' field.

Having done with the app credentials, click 'Save' .

The application is now created.

3. Get the API Key and Secret

Once the app is registered, you will receive an email from the Odnoklassniki team to the email address connected to your account.

This very email will contain the Consumer Key (Application ID)Consumer Secret (Secret Key), and Public Key.

Create an account on Odnoklassniki | Social Login by Aheadworks eCommerce Cloud

  • Copy the Application ID to the 'Consument Key (Application ID)' field of the social login settings in the Magento backend;
  • Copy the Public key to the 'Public Key' field of the social login settings in the Magento backend;
  • Copy the Secret key to the 'Consumer Secret (Secret Key)' field of the social login settings in the Magento backend.

That's it. Once you have saved the store configuration, the corresponding Odnoklassniki button will appear in the set social login block of your store.

Vkontakte

     1. Create an account on Vkontakte

Create an account on Vkontakte | Social Login by Aheadworks eCommerce Cloud

If you are new to Vkontakte, you will first need to create an account.

The account is registered with a email address or phone number. Make sure to fill in all the fields and follow the registration steps provided by Vkontakte.

2. Register a Vkontakte application

Navigate to the VKDevelopers page and get to the 'My apps' page.

Create an account on Vkontakte | Social Login by Aheadworks eCommerce Cloud

Click on the Create an Application to start creating the app.

Create an account on Vkontakte | Social Login by Aheadworks eCommerce Cloud

  • Name the application in the 'Title' field;
  • Select Website as a platform;
  • Paste your store homepage URL into the 'Site address' field;
  • Specify the store's Base domain.

Click on the Connect Site button. The application is now created.

Now proceed to the app settings page and specify the Authorized redirect URI.

Paste the homepage URL of your store and the /social/account/callback/provider/vk/ path right after into the 'Authorized redirect URI' field (see the example in the picture below).

Create an account on Vkontakte | Social Login by Aheadworks eCommerce Cloud

Click 'Save' button. Now you will need to paste the Application ID and Secure key to the Social Login module settings in your store backend.

3. Get the Application ID and Secret key

Once App is registered and configured, navigate to the settings page of the application to get the required credentials.

  • Copy the Application ID to the 'Consumer Key (API Key)' field of the module settings in the Magento backend;
  • Copy the Secret key to the 'Consumer Secret (API Secret)' field of the module settings in the Magento backend.

That's it. Once you have saved the configuration, the corresponding Vkontakte button will appear in the set social login block of your store.

Pinterest (https stores only)

1. Create an account on Pinterest

Create an account on Pinterest | Social Login by Aheadworks eCommerce Cloud

If you are new to Pinterest, you will first need to create an account.

The account is registered with the email address. Make sure to fill in all the fields and follow the registration steps provided by Pinterest.

2. Register a Pinterest application

On the Pinterest Apps page, read and agree to the Developer terms and click on the Create app button.

Create an account on Pinterest | Social Login by Aheadworks eCommerce Cloud

Fill in the app's name and description and click on the Create button.

The app is now created.

Now, scroll the page down to the 'Platforms' block and paste your store URL into the 'Web' fields.

Paste the homepage URL of your store and the /social/account/callback/provider/pinterest/ path right after into the 'Redirect URIs' field.

Once done, click Save and scroll back to the top of the page.

3. Get the API Key and Secret

At the top of the page of the created app:

  • Navigate to your store backend Stores > Configuration > Aheadworks Ecommerce > Social Login;
  • Copy the App ID and paste it into the Pinterest 'Consumer Key (API Key)' field of the module settings;
  • Copy App secret and paste it into the Pinterest 'Consumer Secret (API Secret)' field of the module settings.
  • Don't forget to enable Pinterest and save the changes.

Create an account on Pinterest | Social Login by Aheadworks eCommerce Cloud

That's it. The corresponding Pinterest button will appear in the set social login blocks of your store.

PayPal

1. Create an account on PayPal.

Create an account on PayPal | Social Login by Aheadworks by eCommerce Cloud

If you are new to PayPal, you will first need to create an account.
Make sure to fill in all the fields and follow the registration steps provided by PayPal.

2. Register a PayPal application

Create an account on PayPal | Social Login by Aheadworks by eCommerce Cloud

  • Enter the app's name and click Create App to complete the process.

In the top right-hand corner of the page, you can toggle between the sandbox and live app information.

Create an account on PayPal | Social Login by Aheadworks by eCommerce Cloud

Insert the return URL addresses both into the 'Sandbox' and 'Live' fields. The return URL should be of the following type: http://[Your doamin name]/index.php/social/account/callback/provider/paypal/ 
  • Deselect all the checkboxes except Log In with PayPal and fill in all the information requested when you choose Advanced Options. Finally, save all the changes you have made.

Create an account on PayPal | Social Login by Aheadworks by eCommerce Cloud

3. Get the API Key and Secret

  • Copy the Client ID and Secret from the corresponding fields in the Sandbox API Credentials;

Create an account on PayPal | Social Login by Aheadworks by eCommerce Cloud

When making API calls, you need to use the sandbox or live account's client ID and secret credentials for authorization.

The sandbox credentials are applied for testing. For live transactions, live credentials are to be applied. By the way, for live transactions, you need to upgrade from a personal to business PayPal account.

  • Navigate to Stores > Configuration > Aheadworks Ecommerce > Social Login;
  • Paste the Client ID into the Consumer Key field and the Client Secret into the Consumer Secret field of the configuration section.

That's it. Once enabled, the corresponding PayPal button will appear in the set social login block of your store.

How an Account is Created?

Whenever customers click a social login button, they get redirected to the corresponding social network page. On the social network page, they need to confirm that they want to use their social accounts to log in to the store.

Social Networks on the frontend | Social Login by Aheadworks eCommerce Cloud

Once confirmed, the customer is taken back to the store. The account is created.

 

How Do I Set up the Module?

The module introduces its settings section in Stores > Configuration > Aheadworks Ecommerce > Social Login.

Within this section, you can decide on which store pages social login blocks should be displayed. Additionally, you can include/exclude the required social networks from the social login block.

The section comes with the following settings:

  • Enable Social Login - enables/disables the module's output;
  • Login Blocks - enables/disables the default login blocks and allows adding custom blocks;

Social Login configurations | Social Login by Aheadworks eCommerce Cloud

  • Twitter/Facebook/Google/LinkedIn/Instagram/Pinterest/Vk/Odnoklassniki/Paypal - these sections allow enabling/disabling particular social networks for logging-in purposes and store appropriate consumer keys and secrets.

Social Networks configurations | Social Login by Aheadworks eCommerce Cloud

 

How Do I Manage Social Accounts?

Another section the module introduces to the store backend is 'Social Accounts' found under Customers > Social Login by Aheadworks > Social Accounts.

 

How do I Manage the Customer Area?

At the frontend of the store, the Social Login feature introduces the 'My Social Accounts' customer account section.

In this section, customers can view and manage their social accounts (by linking new and unlinking current ones).

Having linked a social account, customers can log in to the store in one click and then proceed to the catalog.

Rich Banner Slider introduces its sections under Content > Rich Banner Slider by Aheadworks. The module comes with three sections:

  • Slides - allows store administrator create and manage slides;
  • Banners - allows store administrator to create and manage banners;
  • Statistics - provides an overview of the banner and slides performance.

 

How Do I Add Social Login Widgets?

Widget Layout Update

New login blocks can be added to custom positions through the native Magento widget functionality.

To add a new widget, navigate to ContentElementsWidgets and click on the Add Widget button.

Widget Layout Update | Social Login by Aheadworks eCommerce Cloud

Choose Social Login in the 'Type' dropdown and click on the Continue button.

On the widget options page, configure the widget as per your requirements:

  • Define the widget's name;
  • Store view;
  • Position.

Once the widget is saved, a new social login block will be displayed in the position set.

Adding the Widget to Website Pages

To add the widget to a particular CMS page of your store, the first thing you need to do is to create a new login block. Navigate to the module settings in StoresConfigurationAheadworks EcommerceSocial Login.

In the 'Login Blocks' configuration section:

  • Click on the Add button;
  • Name the new Login Block ('Page widget' as per illustration);
  • Click on the Save Config button.

Adding widget to website page | Social Login by Aheadworks eCommerce Cloud

After the login block is added, navigate to Content > Elements > Pages and add new or select the existing page:

In the content field of the page, select the required position:

  • Click Edit with Page Builder button;
  • Set Widget Type to Social Login;
  • In the Widget Options, select the new Login Block you created ('Page widget' as per illustration);
  • Click on the Insert Widget button.

Now you can save the CMS page, and the Login Block will be displayed in the required position.

Report incorrect information

Still Have Questions?

Our customer care team is here for you!

Contact Us