定制 jeanmarcos/module-admin-bypass 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jeanmarcos/module-admin-bypass

Composer 安装命令:

composer require jeanmarcos/module-admin-bypass

包简介

Magento 2 development module that bypasses admin authentication and auto-logs in a hardcoded developer user. For local development only — guarded against production mode.

README 文档

README

📦 jeanmarcos/module-admin-bypass — published to Packagist.

🏠 Source repository for issues, PRs and releases: jeanmarcos-dev/magento-local-development. The standalone jeanmarcos-dev/module-admin-bypass repo is a read-only mirror auto-generated by CI on every release — direct commits to it are overwritten.

Development_AdminBypass

Packagist

⚠️ FOR LOCAL DEVELOPMENT ONLY — NEVER ENABLE IN PRODUCTION

Bypasses Magento 2 admin authentication and auto-logs in a hardcoded development user (local / local123) whenever the admin login page is visited.

What it does

  • BypassAdminAuthentication (plugin around on Magento\User\Model\User::verifyIdentity) — accepts any password for any existing admin user.
  • AdminAutologin (plugin around on Magento\Backend\Controller\Adminhtml\Auth\Login::execute) — when /admin is visited and nobody is logged in, creates the admin user local (password local123, email john.smith@gmail.com, role Administrators) if missing and authenticates as that user. Redirects to */dashboard.

Safety model

This module is guarded by Magento's application mode:

Mode Allow in Production flag Behavior
developer / default any active — bypass and autologin work
production No (default) inactive — Magento behaves normally, no user is created
production Yes active — explicit override (use at your own risk)

The guard is implemented in Development_Core (Development\Core\Model\ProductionGuard::isEnabled()) and wired into every plugin via a virtualType in etc/di.xml that binds it to the config path development/admin_bypass/allow_in_production. In production + flag off, the plugins short-circuit with $proceed(...) and do not create the local user nor touch authentication.

Configuration

Panel path: Stores → Configuration → ⚠ Development Modules → Admin Bypass → General → Allow in Production

  • Default: No.
  • Changing this flag requires bin/magento cache:clean config to take effect.

Install

composer require --dev jeanmarcos/module-admin-bypass
bin/magento module:enable Development_AdminBypass
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush

Kill switch (strongly recommended before any deploy)

bin/magento module:disable Development_AdminBypass
bin/magento setup:upgrade
bin/magento cache:flush

The disable path is the last line of defense — it removes the module entirely regardless of the allow_in_production flag.

For permanent removal:

composer remove jeanmarcos/module-admin-bypass

Security risks (read before using)

  • Anyone who can reach /admin gains full Administrators access when the bypass is active. No password needed.
  • The hardcoded local/local123 admin user persists in the database once created, even after disabling the module.
  • Credentials are in plain text in Plugin/AdminAutologin.php and are searchable in git history.

After disabling the module in a shared environment, consider deleting the local admin user manually:

DELETE FROM admin_user WHERE username = 'local';

File structure

AdminBypass/
├── Plugin/
│   ├── AdminAutologin.php             # autologin around plugin
│   └── BypassAdminAuthentication.php  # password bypass around plugin
├── etc/
│   ├── acl.xml                        # ACL for the config section
│   ├── adminhtml/
│   │   └── system.xml                 # admin panel toggle
│   ├── config.xml                     # default values
│   ├── di.xml                         # plugin wiring + ProductionGuard virtualType
│   └── module.xml                     # module declaration (depends on Development_Core)
├── composer.json
├── registration.php
└── README.md

The production-guard helper lives in the shared core package jeanmarcos/module-core-local-development.

Troubleshooting

  • Toggle doesn't take effect: bin/magento cache:clean config.
  • Bypass still works after module:disable: check app/etc/config.php for the module entry; run setup:upgrade.
  • Autologin loops: another plugin on Login::execute may be conflicting; inspect generated/code/Magento/Backend/Controller/Adminhtml/Auth/Login/Interceptor.php.

Compatibility

  • Magento 2.4.x
  • PHP 8.1+ (uses constructor property promotion and readonly properties)
  • Depends on jeanmarcos/module-core-local-development (installed automatically by Composer).

License

MIT

jeanmarcos/module-admin-bypass 适用场景与选型建议

jeanmarcos/module-admin-bypass 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「admin」 「development」 「auth」 「magento」 「autologin」 「bypass」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 jeanmarcos/module-admin-bypass 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 jeanmarcos/module-admin-bypass 我们能提供哪些服务?
定制开发 / 二次开发

基于 jeanmarcos/module-admin-bypass 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 44
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-27