Force Login extension icon

Force Login for Magento 2

Require customers to log in before browsing the store or selected pages, for B2B and private stores.

Customer & Support Magento 2.4.x Open Source & Adobe Commerce Adobe Marketplace approved $29 USD

Why choose Force Login?

Force Login requires visitors to sign in before they can browse the store, which suits B2B, wholesale and members-only shops. You choose which page types are protected, add exceptions for pages that must stay public, set where customers land after logging in and customise the message they see. APIs are not affected.

Force Login: Frontend (screenshot 1 of 3)Force Login: Configuration (screenshot 2 of 3)Force Login: Message exceptions (screenshot 3 of 3)
1 / 3

Key features

  • Master Enable / Disable Switch
  • Independent Page-Type Toggles
  • Custom URL Paths (Link Manager)
  • Configurable Post-Login Redirect
  • Custom Alert Message
  • Exceptions List
  • Safe by Default
  • Zero Impact on APIs
  • Store-View Scope Throughout
  • Zero Core Code Modifications

At a glance

Module nameMage2Expert_ForceLogin
Composer packagemage2expert/module-force-login
SettingsStores › Configuration › Mage2Expert › Force Login (8 options)
Admin menuContent › Force Login › Custom URL Paths
Per store view settingsYes
APINo custom endpoints (uses Magento's standard APIs)
PHP8.1, 8.2, 8.3, 8.4, 8.5

Installation

After purchasing on the Adobe Commerce Marketplace, install it with Composer using your Marketplace access keys:

composer require mage2expert/module-force-login
bin/magento module:enable Mage2Expert_ForceLogin
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento cache:flush

Skip setup:di:compile and static-content:deploy if your store runs in developer mode.

Configuration reference

All 8 options under Stores › Configuration › Mage2Expert › Force Login, grouped as they appear in the admin.

General Settings 4
SettingDescription
Enable Force LoginWhen enabled, guests must log in before viewing the restricted page types below.
Require Login for Product Pages 
Require Login for Category Pages 
Require Login for CMS Pages 
Redirect Behavior 2
SettingDescription
After Login, Redirect ToWhere a visitor lands after signing in from the forced login page.
Custom Redirect URLRelative path (e.g. "special-offers") or absolute URL. Used when the option above is set to "Redirect to Custom URL".
Message 1
SettingDescription
Alert MessageShown to visitors when they are redirected to the login page. Leave empty to show no message.
Exceptions 1
SettingDescription
Exception URL PathsOne relative URL path per line (e.g. "about-us" or "special-category.html"). Customer login/register/forgot-password pages are always accessible regardless of this list.

Frequently asked questions

How much does Force Login cost?
Force Login costs $29 USD as a one-off purchase on the Adobe Commerce Marketplace.
Which Magento and PHP versions are supported?
Magento Open Source and Adobe Commerce 2.4.x. It is developed and tested on Magento 2.4.8, and supports PHP 8.1, 8.2, 8.3, 8.4, 8.5.
Where do I configure Force Login?
In the Magento admin under Stores › Configuration › Mage2Expert › Force Login. It has 8 options, grouped into 4 sections.
Can I switch it off without uninstalling it?
Yes. Set "Enable Force Login" to No under Stores › Configuration › Mage2Expert › Force Login. Your settings and data are kept.
Can the settings differ per store view?
Yes. Many options can be set per website and store view, so multi-store and multi-language setups can behave differently.
Can it be customised for my store?
Yes. As the developer of Force Login, I can adapt it to your workflow or build related features. Email me with what you need.
Available for new projects

Have a Magento project in mind?

Tell me about your store and what you need. I reply to every enquiry within one business day.

Adobe Certified Expert

Adobe Commerce Developer certification, verified on Credly.

15+ years of Magento

From Magento 1 to Magento 2.4.x, Adobe Commerce and Hyvä.

62 Marketplace extensions

Each one reviewed and approved by Adobe.