1. Home
  2. Docs
  3. Magento 2 B2B Extensions
  4. Magento 2 Force Login
  5. User Guide

User Guide

1. Overview

Magento 2 Force Login extension requires customers to log in to view specific pages on your website, which are freely set up by you. When they are redirected to login page, an alert message will be shown. After successful login, you can let customers redirect to your chosen pages.

2. How Does It Work?

Please go to Store Configuration BSSCommerce Force Login

2.1 General configs

orce Login General Configurations

In Enable: choose Yes to enable the Force Login functions.

In Disable Registration: choose Yes to disable the Registration link on the top link and login page, or No to enable it for the customer to sign up.

2.2 Enable "Force Login" When users visit pages

Page Types to Force Login

In Alert Message: edit a force login message to be shown on the restricted page.

Select types of page to force login to access:

  • Product Page
  • Category Page
  • Cart Page
  • Checkout Page
  • Search Term Page
  • Advanced Search Page
  • Search Results Page
  • Contact Page
  • Other Pages
  • CMS Pages


  • Other Pages are custom pages created by third-party extensions, for example, the FAQs
  • We support specific CMS Page to force login: 404 Not Found; Home Page; Enable Cookies; Privacy Policy; About us; Customer Service.

2.3 Redirect users after successful login

It is important to streamline the experience of users after "force-login" requirement. You can choose among 4 redirect options.

  • Default: redirect users to the page after login like default Magento 2
  • Home Page: redirect users to Home Page after login
  • Previous Url: redirect users to the page they are trying to access when they are forced to login
  • Custom Url: Enter the page URL that you want to send your customers to after login
Redirect after Login


  • With custom pages by third-party extensions, if you select this option, you will be redirected to the previous page of the force login page.

For example: You require a login to access the FAQs page.

A customer goes to the Home page Women (category page) FAQs page and login. He/She is redirected to Women (category page).

  • Remember to Save Config on completing

2.4 Google reCAPTCHA & 2FA installation

Magento is adding Google reCAPTCHA and 2FA functionality to all Magento Commerce and Open Source versions 2.1 and above to reduce unauthorized access and spam.

  • Google reCAPTCHA technology is to ensure the access attempt by humans only, not bots. Compared with Magento CAPTCHA module, the reCAPTCHA enhances security with additional benefits includes support for invisible reCAPTCHA.
  • 2FA Authentication adds support for software authentication apps and hardware authentication devices provided by Google Authenticator, Authy, U2F devices, and Duo Security, among others.

Hence, BSS Commerce strongly recommends installing these functions for your Magento 2 Website.

Please go to the Magento 2 Dev Document for more information.

Was this article helpful to you? Yes No

How can we help?