{"id":18840612,"url":"https://github.com/bitexpert/magento2-force-login","last_synced_at":"2025-05-16T14:08:25.819Z","repository":{"id":5733400,"uuid":"53792961","full_name":"bitExpert/magento2-force-login","owner":"bitExpert","description":"Force Customer Login Module for Magento 2","archived":false,"fork":false,"pushed_at":"2024-05-01T17:52:29.000Z","size":5243,"stargazers_count":167,"open_issues_count":4,"forks_count":73,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-05-15T12:46:57.496Z","etag":null,"topics":["force-login","magento2","magento2-extension","magento2-module","php","whitelist-login"],"latest_commit_sha":null,"homepage":"https://marketplace.magento.com/bitexpert-magento2-force-customer-login.html","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitExpert.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-13T15:43:06.000Z","updated_at":"2025-03-19T05:57:56.000Z","dependencies_parsed_at":"2023-11-12T16:28:35.806Z","dependency_job_id":"d84262e5-eacb-4c7d-a992-5a14c6ac62f1","html_url":"https://github.com/bitExpert/magento2-force-login","commit_stats":{"total_commits":285,"total_committers":29,"mean_commits":9.827586206896552,"dds":0.5964912280701755,"last_synced_commit":"2262f5f9c3e96f9fbbf74825fe5896d2f1d9a2ea"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitExpert%2Fmagento2-force-login","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitExpert%2Fmagento2-force-login/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitExpert%2Fmagento2-force-login/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitExpert%2Fmagento2-force-login/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitExpert","download_url":"https://codeload.github.com/bitExpert/magento2-force-login/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254544146,"owners_count":22088807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["force-login","magento2","magento2-extension","magento2-module","php","whitelist-login"],"created_at":"2024-11-08T02:48:19.103Z","updated_at":"2025-05-16T14:08:20.810Z","avatar_url":"https://github.com/bitExpert.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Force Login Module for Magento® 2\n\n[![Build Status](https://github.com/bitExpert/magento2-force-login/workflows/ci/badge.svg?branch=master)](https://github.com/bitExpert/magento2-force-login/actions)\n[![Coverage Status](https://coveralls.io/repos/github/bitExpert/magento2-force-login/badge.svg?branch=master)](https://coveralls.io/github/bitExpert/magento2-force-login?branch=master)\n[![Mastodon Follow](https://img.shields.io/mastodon/follow/109408681246972700?domain=https://rheinneckar.social)](https://rheinneckar.social/@bitexpert)\n\nThe **Force Login** Module for *Magento® 2* allows you to restrict which pages a visitor is\nable to see. Visitors get redirected to the login page if the page is not marked visitable.\nThe **Force Login** Module for *Magento® 2* is especially useful for merchants serving only a specific\ngroup of users, e.g. enterprise related business partners and need to ensure that only those users are\nable to browse the the website or the product catalog.\n\n## Features:\n* Force your guest visitors to log in first (or register), before allowing them to visit your pages and catalog\n* Administration: Manage the whitelist rules by the GUI in the administration area\n* ACL: Restrict the administration of whitelist rules to certain backend user groups\n* Whitelisting: Define url rules as pattern to define which pages guest visitors can visit without logging in first\n* Multistore-Support: Define if whitelist rules either apply globally or for specific stores\n* [Hyvä Themes](https://hyva.io) compatible\n\n## Requirements:\n* PHP 7.4 or PHP 8.1\n* Magento 2.4.0 or higher\n\n## Installation\nThe preferred way of installing `bitexpert/magento2-force-customer-login` is through Composer. Simply add `bitexpert/magento2-force-customer-login` \nas a dependency:\n\n```\ncomposer.phar require bitexpert/magento2-force-customer-login\n```\n\nOptional you can download the latest version [here](https://github.com/bitExpert/magento2-force-login/releases) and install the\ndecompressed code in your projects directory under *app/code/BitExpert/ForceCustomerLogin*.  \n\n#### Composer error package bitexpert/magento2-force-customer-login exists\nWhen you have errors after installing trough composer there is probably an issue with version numbers between Packagist and Magento repo. You can update your project composer file to fix this: \n```\n{\n  \"repositories\": [\n    {\n      \"type\": \"composer\",\n      \"url\": \"https://repo.magento.com/\",\n      \"canonical\": false\n    }\n  ]\n}\n```\n\n## Post-Install\n\nAfter the installment of the module source code, the module has to be enabled by the *Magento® 2* CLI.\n\n```\nbin/magento module:enable BitExpert_ForceCustomerLogin\n```\n\n## System Upgrade\n\nAfter enabling the module, the *Magento® 2* system must be upgraded. \n\nIf the system mode is set to *production*, run the *compile* command first. This is not necessary for the *developer* mode.\n```\nbin/magento setup:di:compile\n```\n\nTo upgrade the system, the *upgrade* command must be run.\n```\nbin/magento setup:upgrade\n```\n\n## Clear Cache\n\nAt last, the *Magento® 2* should be cleared by running the *flush* command.\n```\nbin/magento cache:flush\n```\n\nSometimes, other cache systems or services must be restarted first, e.g. Apache Webserver and PHP FPM.\n\n# User Guide\nFind the complete user guide [here](./docs/UserGuide.pdf \"User Guide\").\n\n## How to use\nThe usage of the **Force Login** Module for *Magento® 2* is applied implicitly by redirecting visitors \nif the called URI does not match any configured whitelisted url rules.\n\n### Whitelisting\n\nWhitelisting is based upon the usage of rules. The strategy selection defines how the rules are interpreted, [details are listed below](#strategies).\nBy default, some static rules are already listed. The following example shows, how to add a whitelist entry for the homepage (startpage).\n\nNavigate to the **Overview Grid** and use the *Add Entry* button.\n\n- Enter **Homepage** into the text field beside from the **Label** label.\n- Enter **^/?$** into the text field beside from the **Url Rule** label.\n- Select **All Stores** from the selection field beside from the **Store** label.\n\nUse the **Save** button in the upper menu. After being redirected to the **Overview Grid**, the new \nentry should appear to the list and the systems homepage should be available for guest visitors.\n\n## How to configure\n\n### Administration\n\nThe **Force Login** Module for *Magento® 2* allows you to enable or disable the module itself on the level of websites, stores and store views.\n\nIf the module is *disabled*, the whitelist ruling and the redirection are not applied. If the module is *enabled* based upon the configuration,\nthe whitelist rules are process, which themselves are also configurable for all enabled stores or just specific ones.\n\nAfter installing and enabling **Force Login** Module for *Magento® 2* with the CLI, you must be able to navigate to \n*Stores \u003e Configuration \u003e Force Login*, where you are able to configure the availability of the module for each website, store and store view.\n\nIn the administration configuration, you are also able to setup the URL the redirecting is targeting to if not whitelist rule is matching.\n\n![alt text](./resources/ui_step_00.png \"Administration\")\n\n### Navigation\nNavigating through the *Magento® 2* backend menu by clicking onto **Customers** you must see a new menu \nentry **Forced Login Whitelist**. \n\nEnter this menu entry.\n\n![alt text](./resources/ui_step_01.png \"UI Navigation\")\n\n### Overview Grid\nYou can add new entries by clicking on the *Add Entry* button in the upper right corner ( **1** ), [see below](#detail-form). \nThe grid ( **2** ) contains all existing whitelisted *Url Rules*, for which the forced redirect to the *Customer Login Page* is omitted.\nThe *Url Rules* ( **3** ) are part of a regular expression checking on the called *Url* and tries to match against the whitelist.\n*Url Rules* may be related to all stores or to a specific one ( **4** ). All rules except some mandatory ones are editable ( **5** ) and removeable ( **6** ).\n\n![alt text](./resources/ui_step_02.png \"UI Grid\")\n\n### Detail Form\nYou can return to the *Overview Grid* by using the *Back* button ( **1** ). The *Label* value has only declarative character and\nis for information purpose only ( **2** ). The *Url Rule* is an expression checking on the called \n*Url* and tries to match against the whitelist ( **3** ). *Url Rules* may be related to all stores or to a specific one ( **4** ).\nThe strategy selection ( **5** ) defines how the *Url Rule* is interpreted, [details are listed below](#strategies).\nPersist the rule by using the *Save* button ( **6** ).\n\n![alt text](./resources/ui_step_03.png \"UI Form\")\n\n### Strategies\n\n#### Static\nRule is used as a literal value and will be added onto the base url for matching. This is default behaviour. \n\n#### RegEx-All \nRule is based on [regular expression](https://en.wikipedia.org/wiki/Regular_expression), and will be used for looking up matching anywhere in the current Url.\n\n#### RegEx-All Negation\nBased on the *RegEx-All* strategy, but negates the result. Helpful if only a few pages should be restricted.\n\n## Tests\n\nYou can run the unit tests with the following command (requires dependency installation):\n\n    composer test\n\n## Contribution\nFeel free to contribute to this module by reporting issues or create some pull requests for improvements.\n\n## License\nThe **Force Login** Module for *Magento® 2* is released under the Apache 2.0 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitexpert%2Fmagento2-force-login","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitexpert%2Fmagento2-force-login","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitexpert%2Fmagento2-force-login/lists"}