aligent/bypass2fa
Composer 安装命令:
composer require aligent/bypass2fa
包简介
Magento 2 module for bypassing 2-factor authentication in local development environments.
README 文档
README
This module is designed to allow developers to bypass the need for 2-factor authentication (2FA) in local development environments.
Configuration
The bypassing of 2FA is made possible for both admin access and the generation of admin tokens via API.
Both methods of access are controlled by setting variables in the environment's app/etc/env.php file:
BYPASS_2FA_ADMINwhen set totrue(must be a boolean, setting truthy or falsy values like 1, 'true' is not supported), this variable allows bypassing of 2FA for admin actions.BYPASS_2FA_APIwhen set totrue, this variable allows bypassing of 2FA for admin token generation.
Additionally, there is an added security measure, to prevent 2FA being bypassed accidentally (or intentionally) in production environments.
The app/etc/config.php file must have the following config setting added under system => default:
'system' => [
'default' => [
'bypass_2fa' => [
'settings' => [
'allowed_hostnames' => [
'hostname1',
'hostname2',
...
],
'allowed_usernames' => [
'username1',
'username2'
]
]
]
]
]
The configured (partial) hostnames are checked against the base URL, with the configured name needing to be contained wholly within the base URL.
If no match is found, then 2FA is not bypassed for the request.
By committing this setting to the codebase, it prevents someone from overriding the allowed hosts in environments such as Magento Cloud hosting (where app/etc/config.php is not writable).
Magento Cloud
Magento Cloud environment-specific variables can be used to switch this feature on and off on a per cloud instance, especially
useful for integration environments where emails may not be configured. First make sure that you've added
the hostname to config.php in the allowed_hostnames section, and then also check you've added the usernames in the allowed_usernames section that need to be bypassed 2FA when generating the admin tokens.
Then, in the Cloud dashboard:
- Click
Configure enviromentand enter theVariablestab - Add
env:BYPASS_2FA_ADMINandenv:BYPASS_2FA_APIas needed, setting the value to 1 to enable bypass
aligent/bypass2fa 适用场景与选型建议
aligent/bypass2fa 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 22.51k 次下载、GitHub Stars 达 6, 最近一次更新时间为 2022 年 03 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 aligent/bypass2fa 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aligent/bypass2fa 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 22.51k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Massachusetts
- 更新时间: 2022-03-10