B2B Force Login for Magento 2
- Compatibility
- 2.4.9, 2.4.8, 2.4.7, 2.4.6, 2.4.5, 2.4.4, 2.4.3, 2.4.2, 2.4.1, 2.4.0, 2.3.7, 2.3.6, 2.3.5, 2.3.4
Description / B2B Force Login for Magento 2
MAGENTO 2 · B2B SALES · STORE ACCESS
Make your offer available to customers after login.
Kowal B2B Forced Login
Turn your Magento store into a sales environment for business partners. Redirect visitors who are not logged in to the login page, choose access to registration, and set exceptions for required URLs.
Required login · Two access modes · Per-store settings
HOW IT WORKS IN PRACTICE
01 · You choose the access mode
You provide login or login with registration.
02 · A guest opens the store
Protected pages redirect to login.
03 · The customer uses the offer
After logging in, they can browse the store.
What does your store gain?
Explore the module features, use cases, and configuration method.
Offer available after login
Magento 2 B2B Forced Login was created for wholesalers, distributors, and stores dedicated to business partners. It limits content browsing by users who are not logged in and helps protect commercial information: price lists, offers, and products.
After activation, protected guest requests are directed to the login page. The access scope depends on the selected mode and configured exceptions.
Two operating modes
- Login: the store provides the login path and supported password recovery actions.
- Login and registration: the customer can also go through the account creation pages.
Match restrictions to the way you acquire business partners: accounts created by your team or new customer requests submitted through the store.
Separate settings for store views
In the Magento admin panel, you can enable and disable the module and select the access mode for individual store views. You can find the configuration in Stores → Configuration → Kowal → B2BForcedLogin.
This lets you adapt access to the store structure and sales rules in a given view.
Exceptions for required URLs
In the configuration, you can enter URL fragments excluded from forced login, one per line. Matching checks whether the request URI contains the given fragment, without case sensitivity.
Use clear fragments and check their scope. This is partial address matching, not a list of exact URLs or wildcard patterns.
Login and business partner verification
Forced Login checks whether the customer is logged in. It does not approve registrations or verify companies on its own. The goal stated in the previous description, prices and products only for verified customers, is achieved by combining the login requirement with account approval.
You can use Kowal Customer Approval for this process. The implementation should also be checked with cache, the theme, and other access channels to the offer.
Magento and implementation support
The product description indicates compatibility with Magento 2.4.x. The package uses kowal/base. The Kowal team offers technical support, implementation assistance, and development tailored to individual customer needs.
During implementation, check login, registration, password recovery, and selected exceptions in each target store view.
Installation via Composer
Package kowal/forcedlogin, module Kowal_ForcedLogin. Configure access to the Kowal repository, install the package, enable the module, update Magento, and clear cache. In production, include compilation and static content deployment according to the store process.
From configuration to results
1. You choose the access mode
You provide login or login with registration.
2. A guest opens the store
Protected pages redirect to login.
3. The customer uses the offer
After logging in, they can browse the store.
Wholesale store with an offer for business partners
A visitor without an active session is sent to the login form. After logging in, they can see the products and price lists prepared for store customers.
If you allow self-registration, add Customer Approval so that access also requires an administrator decision.
Organize access to your B2B offer
Want to adapt the module to your store? Ask about implementing Kowal B2B Forced Login and discuss the configuration or required extensions.
More Information
| Theme compatibility | Luma / Blank, KOWAL |
|---|
Questions and Answers
Can exceptions be set—pages that will be available without logging in (e.g., “Contact,” “Terms and Conditions”)?
Does the module require modifications to Magento core files or the template?
Which stores is this module most useful for?
After installation and activation, are users who are not logged in automatically redirected to the login page?
Is it possible for it to work only partially—for example, allowing access to only some pages without logging in?
Is the module compatible with multiple store views (multi-store) and Magento 2 versions?
Can requiring login negatively affect SEO or site indexing?
Is the module installation simple?
After purchasing the module, do I receive technical support and updates from the manufacturer?
Change Log
Version: 1.0.2
15.02.2026
Added
- Added a new URL Exceptions configuration field in the panel:
- Stores > Configuration > Kowal > B2B Forced Login > Settings
- The field uses a line-by-line format: each line is a URL fragment that should be skipped by the forced login mechanism.
Changed
- Extended the ForceCustomerLoginObserver logic:
- the module reads the list of exceptions from the configuration,
- compares the current request URI with the entered fragments, case-insensitive,
- if the URL matches an exception, it does not redirect to login.
Why
It enables proper handling of webhooks and integration endpoints, such as Stripe in B2B stores, which must be available without a customer session.
Example use cases
- stripe/webhook
- rest/V1/stripe
- /payment/stripe/webhook
Module Installation Instructions
Installation via Composer
You will receive Composer repository access credentials, the customer email address and license token, by email after purchase. They are also available in the customer panel after logging in at kowal.store. Replace TWOJ_EMAIL_KLIENTA with your account email address and TWOJ_TOKEN with the received token. Run the commands in the Magento root directory.
composer config repositories.kowal composer https://repo.kowal.storecomposer config http-basic.repo.kowal.store 'TWOJ_EMAIL_KLIENTA' 'TWOJ_TOKEN'composer require kowal/forcedloginCompleting the installation
After installing the package, update Magento and clear cache:
php bin/magento setup:upgradephp bin/magento cache:flushIn a production environment, also run DI compilation and deploy static files according to your store deployment process.