Magento Open Source admin two-factor authentication setup

A practical plan for enabling, enforcing and recovering two-factor authentication on Magento Open Source admin accounts, including how it interacts with agency access and admin API tokens.

On this page

Why Magento Open Source admin two-factor authentication is a first control to set

Admin two-factor authentication requires a second proof of identity, such as a code from a device a user holds, before the Magento admin panel opens, so a stolen or reused password alone does not grant access. Set it up early, before agency staff or additional administrators receive accounts, and especially if your store is self-hosted and reachable from the public internet. The admin login is the entry point to catalog and pricing changes, order and customer data, payment and API settings, and the users and roles that control everything else. A compromised admin account can therefore alter checkout behavior or redirect payments without touching the server itself.

Treat 2FA as one layer alongside access restriction and least privilege, not as a replacement for them. Restricting the admin path, limiting access by network or VPN, setting session and lockout behavior, and giving each person only the roles their job needs all reduce what an attacker can do even after a second factor is passed. Confirm in your release which two-factor modules and provider options are available, whether they ship with Magento Open Source or come from a third party, and how each one is installed and supported. Check the Magento Open Source 2.4.9 release notes and your own version's documentation rather than assuming a feature set. Ask whether your provider supports the authenticator and recovery methods your staff will actually use.

Which 2FA provider fits which admin population

This table compares the admin 2FA provider options against the people who sign in, the device rules they can follow, the recovery work each option creates and the audit evidence it leaves behind. Read each row as a question to answer for your own admin population, then confirm the provider's behavior on your exact release before you commit. The main takeaway is that the provider matters less than the enforcement scope and the recovery process you put around it.

Decision factorBundled TOTP authenticator pathOther provider your release or extension supports
Best fit admin populationIn-house store administrators who use company-managed phones or laptopsAgency staff or contractors who work on unmanaged devices, if the provider supports their device type
Device policyRelies on each user's authenticator app; confirm which apps are supported on your versionConfirm whether the provider needs a hardware key, push app or SMS, and whether your device policy allows it
Recovery burdenLost device requires an admin reset through the command line or another admin; plan this before launchRecovery depends on the provider's enrollment and reset flow; confirm who can approve a reset
Audit evidenceConfirm what enrollment and login events are logged and where, for your reviewConfirm whether the provider writes its own logs and whether they can be exported to your SIEM
Offboarding agency staffDisable the admin account and confirm no enrolled device remains usableRemove the user from the provider as well as Magento, and confirm both steps are in your checklist
Enforcing on all rolesEnforcing 2FA for all roles covers every admin account, including those with full access, and avoids gaps from forgotten exceptionsSame trade-off: all roles gives the strongest coverage but raises the number of enrollments and resets your team handles
Enforcing on selected rolesSelected-role enforcement suits a mixed team, but every role without 2FA becomes a path to change settings, so review it against your least privilege modelSelected-role enforcement works only if you can prove which roles are exempt and why, which an assessor will ask for
Confirm before choosingAvailability and behavior of the bundled 2FA module on your exact version and patch levelCompatibility of the provider with your Magento version, PHP version and admin SSO setup

How to enable and enforce admin 2FA step by step

This sequence moves admin two-factor authentication from a planned control to an enforced one, with a check at each stage so the team can show that a password alone no longer opens the Magento Open Source admin.

  1. Confirm the release and enabled modules

    The engineer responsible for the store checks the installed Magento Open Source version and confirms that the two-factor authentication modules shipped with the release are present and enabled. Run the module status command from the store root and compare the output against the release you are running, because the 2FA modules and their names can differ between 2.4.x lines. Confirm the exact module names in the Adobe documentation for your version before changing anything. Done means the modules you need show as enabled in a staging copy of the store, and you have written down the version and module list for the change record.

  2. Enable the provider in admin configuration

    An administrator with configuration rights opens the Stores configuration section for the admin security settings and turns on the chosen two-factor provider in staging first. Follow the configuration path in the Adobe guides for your version, since menu labels and group names can change between releases, and confirm them before you start. Save the change, then clear the configuration cache if the store requires it. Done means the provider appears as active in the configuration view and the change is recorded with the person who made it and the time it was made.

  3. Enroll a test admin account

    Create a dedicated test administrator in staging with a role that matches a real staff role, then sign in and complete enrollment with the chosen provider. Scan or enter the setup key into an authenticator app, or follow the provider flow your version uses, and record the one-time recovery material the store issues. Use a device that is not the engineer's daily phone so that the test does not depend on a personal device. Done means the test admin can complete a full login with the password and the second factor, and the enrollment is visible in the account's security settings.

  4. Verify login blocks without the second factor

    Sign out, then attempt to sign in as the test admin using only the password. The login must be refused or must stop at the second factor prompt, and no admin session should open. Repeat the attempt with a wrong one-time code to confirm that the store rejects it. Check the admin login log or the store logs for the failed attempts, so you can show that the control was exercised. Done means both tests fail to reach the admin dashboard, and the results are saved in the test record.

  5. Enforce 2FA for all admin roles

    Schedule a change window, then extend the requirement to every admin role, including agency accounts, integration owners who sign in as people, and any shared or break-glass accounts that the store still uses. Before the change, list every active admin user and role from the admin user grid so that no account is missed. Apply the enforcement setting in production during the window, and tell staff and agencies in advance how enrollment works. Done means the list of admin users has been reconciled against the enforced setting, and each account is either enrolled or scheduled for enrollment.

  6. Test login with and without the second factor

    Using a sample of real admin accounts in production or a production-like environment, sign in with the password and the second factor, then sign in with only the password. The first attempt must succeed and the second must fail. Confirm that a session expires and that re-authentication is required under the store's session settings. Check that the admin API tokens used by integrations still work, since 2FA applies to interactive admin logins and not to integration token authentication in the way people often assume, so confirm this behavior for your version. Done means the test results match expectations for each role type you tested.

  7. Record the recovery procedure

    Write down how an administrator regains access when a device is lost, replaced or stops working. The procedure should name the person who can approve a reset, the evidence required before a reset, the command or admin path used to clear a user's second factor, and where the reset is logged. Store it with the security runbook and test it once in staging with a dummy account. Done means the procedure has been dry-run successfully, the approver is named, and a second person has read it.

How to onboard agency staff without weakening admin 2FA

The core rule for agency onboarding is that every person who signs in to the Magento admin needs their own account and their own second factor. Two-factor authentication only tells you something useful when it is tied to one identifiable user. If an agency developer logs in with a login shared by three colleagues, the 2FA prompt protects the password but not the audit trail, and removing one person's access means changing a password that everyone else depends on. Ask the agency to confirm, in writing, that it will not share admin logins and that each named user will be created individually in your store.

Account creation should be done by your own administrators, not by the agency staff member being onboarded. In practice this means a store owner creates the admin user, assigns a role, and then sends the user an enrollment step that the person completes on their own device. Enrollment should happen at the first sign-in, so that no one else sees or records the second-factor secret or recovery codes. Confirm with your 2FA provider how enrollment is started, whether recovery codes are shown once, and who can reset a device. Those answers decide whether the agency can onboard a new developer without an administrator handling their phone. Role assignment is the other half of onboarding. Agency users should receive only the permissions their work needs, and the role design itself is covered on the sibling page about securing the Magento admin panel.

Offboarding matters as much as onboarding, because agency contracts end while admin accounts often stay active. Build a removal step into the contract close-out: disable or delete each agency admin account, revoke any device enrollments tied to that user, and confirm that the person no longer appears in the admin user list. Remove agency staff from any shared channels that hold recovery codes or password managers, and check whether the agency has created integration tokens or other credentials that outlive the individual. Ask your agency to name every person who had admin access during the engagement, so you can reconcile that list against your own user records. The exact procedure depends on your provider and your Magento version, so confirm both before the contract starts.

What to do when an admin loses a 2FA device

Admin two-factor authentication fails in predictable ways: a device is lost, a person leaves, or an account looks compromised. Each situation needs a controlled reset by someone with database or command-line access, followed by a check that the new device belongs to the right person. Confirm the exact reset commands for your Magento Open Source version before you write a runbook.

Lost phone with backup codes

The admin still has the one-time backup codes issued at enrollment. The fastest safe path is to sign in with a backup code, then re-enroll a new authenticator from the account settings and retire the old device. Confirm the user has a valid, unused code before relying on this path, because codes are single use. Check that the re-enrollment happened under the same admin account, not a new user, and record the change in your access log. Ask your provider how backup codes are issued and regenerated for the module version you run.

Lost phone with no backup codes

When no backup code exists, an administrator with database or command-line access must reset the second factor for that user. Work from a documented procedure and a change ticket, not an ad hoc query. After the reset, the user signs in with the password, enrolls a new device, and the reset is logged. Before the reset, verify the requester's identity through a channel separate from email, such as a manager call-back to a known number. Confirm the exact config and database steps for your version in the Magento documentation and your provider's module docs.

Admin who has left

A departing admin, employee or agency contractor should lose access in the same change as the offboarding ticket. Disable the admin user first, then remove or reset their 2FA enrollment so a retained phone cannot be used to sign in. Review which API tokens, integrations and scheduled actions the person created, because two-factor authentication does not cover those paths. Confirm that disabling the user blocks active sessions in your version, and check the admin action log for recent activity before the departure date.

Suspected compromise

If an admin's device or password may have been exposed, treat the account as compromised rather than merely locked out. Lock the account, invalidate its sessions, reset the password and clear the second factor, then review admin logins, new users, role changes and configuration edits made since the suspected window. Rotate any credentials or keys the account could read. Re-enrollment should happen only after the investigation has confirmed no tampering. Keep the evidence, and confirm the steps against your incident procedure and the Magento security guidance for your version.

Verifying the new device

Every recovery ends with a check that the new authenticator belongs to the right person. Confirm the enrollment by an out-of-band method, then sign in once and verify that the account name, role and recent activity match what the person expects. Record who approved the reset, when it happened and which device was enrolled, without storing the secret itself. Ask your provider whether the module exposes an enrollment audit trail, and confirm the field names in your installed version.

What admin 2FA does and does not cover for API tokens

Admin two-factor authentication protects interactive logins to the Magento Open Source admin panel. It does not sit in front of integration tokens used by ERP, PIM or marketplace connectors, which authenticate to the REST, SOAP and GraphQL APIs without an admin session. A store can have 2FA enforced for every staff member and still expose a long-lived integration credential that carries broad permissions. Treat the two as separate control planes and plan each one on its own.

Start with an inventory. In the admin, open the integrations list under System, then review the resources each integration can access and the roles of any admin user linked to a connector. Record which integrations have full or broad resource access, which were created by an agency or vendor who has since left, and which have not been used recently. Confirm in your own environment whether an integration's access is governed by admin roles or by its own resource list, and check how the admin reports integration activity before you rely on it for audit evidence. Any integration with administrative reach needs an owner, a documented purpose and a review date.

Those tokens need their own controls because 2FA will not stop a stolen one from being used. Token lifetimes, the set of resources each integration can call, IP restrictions where your connector supports them, and rotation after staff changes all belong in the integration design. The sibling page on securing Magento Open Source REST and GraphQL API access covers token lifetimes and least privilege API users in detail, so use it as the next step. Before you sign off, ask your 2FA vendor or your Adobe documentation review to confirm, in writing, how integration tokens behave when admin 2FA is enforced, and test that behavior on a staging store rather than assuming it.

Security and operational risks to plan for

Two-factor authentication on the Magento Open Source admin only protects the store if enrollment, recovery and monitoring are designed as carefully as the login prompt itself. The cards below cover the gaps we see most often, and they connect because each one is a way an attacker or an absent colleague can get around the second factor.

Service accounts skipping enrollment

Integration and automation users often sit outside the normal admin login flow, so an enforced 2FA policy may not reach them. Check every admin role and user type in the store, including accounts created for ERP or marketplace connectors, and confirm which ones require a second factor. Where a service account must not carry a human second factor, record that exception, restrict its role, and confirm that its API access is governed by its own token policy rather than by admin login rules.

Backup codes stored insecurely

Recovery codes issued by the 2FA provider are as powerful as the primary factor if someone copies them. Staff often keep them in shared spreadsheets, chat threads or unlocked password notes. Ask each provider how backup codes are generated, whether they can be regenerated by an admin, and whether they are shown once. Store them in your approved secrets vault with named access, and treat them like the admin password itself.

Sessions that outlive enforcement

Turning on 2FA does not automatically end sessions that were already authenticated before the change. An administrator who logged in from an unmanaged laptop before enforcement may keep working without a second factor until the session expires. After enabling enforcement, review the session and lockout settings, force a logout for existing admin sessions, and test with a fresh browser profile to confirm the prompt appears on the next login.

Phishing of one-time codes

A time-based code can be relayed in real time through a fake admin login page, so the second factor does not stop a convincing phishing kit on its own. Admin URLs should be known to staff and not reached through email links. Ask the 2FA provider whether it supports phishing-resistant methods such as hardware security keys or passkeys, and document which methods your admins are allowed to use. Train agency staff to report unexpected login prompts.

2FA events without review

Enrollment, failed verification, device resets and disabled factors are the events that show a takeover attempt. If they are not logged or reviewed, an attacker who gets past the password may use a reset flow without anyone noticing. Confirm which 2FA events your provider and the Magento admin action log record, where they are sent, how long they are kept, and who reviews them. Set a named owner for alerts on resets and new device enrollments.

Recovery that has never been tested

A lost phone during an incident is the wrong moment to learn that no one else can approve a device reset. Schedule a recovery drill that resets a test admin account, uses a backup code, and enrolls a replacement device, with a written record of who did each step. Repeat the drill after provider changes, staff turnover or agency onboarding. The aim is a documented path that works when the usual administrator is unavailable.

Questions buyers ask before enabling admin 2FA

How much effort does admin two-factor authentication setup take?

Effort depends less on the Magento configuration itself than on the number of admin accounts, the providers you choose and the recovery design around them. Enabling the module and enforcing it for a handful of in-house admins is a small change. Effort grows when you add agency staff who need their own devices, when different roles need different providers, and when you must prove that lost-device recovery cannot be used to bypass the second factor. Ask any partner to split its quote into admin inventory, provider selection, rollout and recovery testing, so you can see which part your own team could absorb.

Can our internal team set up admin 2FA without a partner?

Often yes, for a small admin group with one provider and a clear recovery process. Your team needs someone comfortable with Magento's admin configuration, the command line on the store server and the change control your organization applies to production. The harder parts are testing recovery paths end to end, deciding how agency accounts are onboarded and documenting the result for your auditors. If those tasks are new to your team, a fixed-scope engagement with written deliverables can cover them while your staff keep ownership of the store.

What do we need to provide before the work starts?

Plan on providing four inputs:

  • A current list of admin users, their roles and which of them are employees, agency staff or contractors.
  • Named admin contacts who can approve provider choices and recovery procedures.
  • Your device policy, including whether staff may use personal phones, hardware keys or company-managed devices.
  • Access to the store's staging environment and a change window for production, plus read access to the admin and configuration settings that control 2FA.

Without the admin inventory and device policy, the provider and recovery design cannot be finished.

How long does planning and testing admin 2FA take?

The duration is driven by how many decisions remain open when the work starts, not by the technical change alone. Planning takes longer when provider choice, agency access and recovery ownership are unsettled. Testing takes longer when you must verify login on each provider, each role and each device type, plus the lost-device recovery path and the scenario where a user loses their device during an agency handover. Ask for a timeline in the written scope that lists these test cases and the staging sign-off that comes before production enforcement. No duration is given here because it depends on those inputs.

Does two-factor authentication affect admin API tokens?

Two-factor authentication applies to interactive admin logins in the browser. It does not turn an integration token into a second-factor login, and an integration that authenticates with a token keeps working without a one-time code. That is why token scope and permissions need their own review: a leaked integration token can still call the APIs it was granted. Confirm the exact behavior for your Magento version with your partner and in your staging environment, and treat token lifetime and least-privilege roles as separate controls that complement 2FA rather than replace it.

What drives the cost of admin 2FA, and what should a quote include?

Cost follows the written scope: the number of admins and agency accounts, the number of providers, the recovery design, the staging and production test work, and the documentation your compliance team needs. Some costs are one-time, such as design, configuration and testing. Others recur when staff join, leave or change devices, and that support usually sits with your team unless you buy a retainer. DeployOpen does not publish a price list. Ask any provider for a quote that lists scope, deliverables, assumptions, your required inputs, test cases, the handover of recovery procedures and any recurring support, with a clear statement of what is excluded.

Which compliance evidence does admin 2FA produce?

Admin 2FA supports access control evidence, but it does not satisfy an assessment on its own. Keep the admin inventory, the enforcement settings as they were configured, staging and production test records, recovery procedure records and the list of users enrolled at each point in time. Map those records to the relevant PCI DSS requirements with your assessor, because the assessor decides whether the controls meet the standard. DeployOpen prepares the systems, controls and evidence for an assessment, but independent auditors and certification bodies issue any audit report or attestation.

How an admin login passes through password and second factor checks

The diagram starts with an admin user submitting credentials in the browser, which sits outside the trust boundary. The login form hands the password to the admin backend, where it is verified before any second factor challenge is issued. Only after the second factor succeeds does the backend create an admin session. Integration tokens take a separate path that never reaches the interactive login, so 2FA does not apply to them and they need their own controls, as covered in the API section.

Interactive admin login with a second factor, and the separate integration token path.

How DeployOpen scopes and delivers admin 2FA

DeployOpen scopes admin two-factor authentication as part of a fixed-scope engagement, with the scope, deliverables and timeline agreed in writing before any configuration changes. The written scope lists which admin roles must enroll, which second-factor providers are approved, how agency and contractor accounts are onboarded and offboarded, and who holds the authority to reset a lost device. Those decisions are documented before work starts, so your security team can review the role and recovery design against its own access policy rather than inferring it from the running store.

Delivery covers the enrollment path and the reset path, and both are tested. Engineers walk through first-time enrollment for each approved role, simulate a lost device and confirm that the documented reset procedure restores access without disabling the factor for everyone. Because admin 2FA interacts with admin API tokens and integration accounts, the test plan also checks which automated accounts remain outside the second factor and whether that exception is recorded. DeployOpen also runs security testing against admin access itself, including login, session and lockout behavior, and can retest after configuration changes, module upgrades or staff turnover. Ongoing support and continuous testing are available as a retainer if your team wants the same controls checked after each patch cycle.

Confirm three things with DeployOpen before you sign: who on your side approves recovery requests, where recovery codes or backup factors are stored, and what evidence you will receive at the end (enrollment records, test results and the retest report). Ask for these items to be named in the written scope so they are not left to interpretation after launch.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.