Enforcing two-factor authentication in Odoo

A planning and setup guide for mandatory two-factor authentication in self-hosted Odoo, covering employees, portal accounts, authenticator apps, lockout recovery, session prompts, API keys and SSO.

On this page

Enforcing two-factor authentication in Odoo: what it does and when you need it

Mandatory two-factor authentication (2FA) in Odoo is a user-account control, so it protects the sign-in step for every account it applies to, whether the database holds finance, sales or HR records. For a self-hosted database, the rollout is mostly a policy, recovery and integration decision: who must enroll, what happens when a device is lost, and how 2FA sits alongside SSO and API access. Odoo's documentation lists two-factor authentication among its supported sign-in features, but the exact enforcement settings, supported authenticator apps and edition requirements change between versions. Confirm each of these against the documentation for the version you deploy before you write the policy.

The users who most often need a second factor are employees with administrator rights, finance users who can post entries or approve payments, and HR users who can see personal data. Portal users need a closer look. A customer or vendor who signs in to view orders or invoices holds less access than an internal user, but the account still exposes commercial data and can be targeted with credential stuffing. Ask whether your Odoo edition and version let you require 2FA for portal accounts separately from internal accounts, and decide whether the answer is the same for both groups. Document that decision alongside the group design, since the two are linked.

Before enabling enforcement, plan the recovery path. Decide who can reset a user's second factor, how that person is verified, and whether a lost device is handled by an administrator or by a helpdesk process. Test this with a non-production copy of the database, not with a live account. Also confirm how 2FA interacts with API keys, which typically authenticate without an interactive login, and with any SSO provider you connect, since the identity provider may already enforce its own second factor. Record these answers in your access policy so auditors and your own security team can see how each sign-in path is covered.

Which 2FA scope fits employees, portal users and API access

This table compares four scopes for two-factor authentication in Odoo: internal users, administrators, portal accounts and API or integration accounts. Read each row for the risk it addresses, the friction it adds, who must enroll and how much recovery work it creates. The main takeaway is that interactive sign-in, portal access and API keys each need their own decision and their own recovery plan.

ScopeRisk it addressesFriction and who must enrollRecovery burden
Internal users (all employees)Stolen or reused passwords on accounts with access to finance, HR, sales and inventory dataEvery employee signs in with an authenticator app. Expect questions from staff who work on shared or kiosk devices.High volume, but usually handled by an internal administrator resetting the second factor after identity checks
Administrators onlyCompromise of accounts that can change settings, install modules or access all companiesSmallest group enrolls first. Lowest day-to-day friction, but ordinary users stay on password-only sign-in.Low volume. Keep at least two administrators able to recover each other, and document a break-glass path
Portal and customer accountsAccount takeover of external users who can view quotes, invoices and ordersExternal people enroll on their own devices. Internal staff cannot easily reach them, so support requests arrive by email or phone.Potentially high volume with weak identity checks. Confirm the recovery channel and who approves resets before enforcing
API and integration accountsMisuse of long-lived credentials that drive scripts, connectors and automationsInteractive two-factor prompts do not apply to machine calls. Plan API keys separately with scope, rotation and ownership.Recovery is key rotation, not a second-factor reset. Track which integration uses each key

How to turn on mandatory 2FA in Odoo step by step

This sequence moves Odoo from optional to mandatory two-factor authentication in controlled stages, so each change is tested with a pilot group before it reaches every internal user and the team knows how a locked-out user gets back in.

  1. Confirm version, edition and sign-in methods

    The administrator records the Odoo version, whether the database runs Community or Enterprise, the hosting type, and every sign-in method in use, such as local passwords, LDAP, or OAuth providers. Confirm the exact menu locations and setting names for two-factor authentication in the documentation for that version rather than relying on memory, since they can change between releases. The step is done when the team has a written note of these facts and a list of which accounts sign in through an external provider, because those accounts may not follow the same local 2FA prompt.

  2. Enable 2FA for a pilot group

    The administrator turns on two-factor authentication for a small group of internal users, typically IT staff and one or two volunteers from a daily-use department, and leaves everyone else unchanged. Use a test database or staging copy first where possible, so the first prompts and any side effects appear away from production. The step is done when each pilot user has been prompted at sign-in and the administrator can see the enrollment status for each of them.

  3. Test enrollment with chosen authenticator apps

    Each pilot user enrolls with the authenticator app the organization plans to support, and the team repeats the enrollment on at least one other app or device type to find gaps. Check that the setup code or QR code displays correctly in the browsers and screen sizes staff use, and that the six-digit codes are accepted. Confirm which apps your Odoo version documents as compatible. The step is done when each pilot user has completed a sign-in from a clean browser session using a second device to receive the code.

  4. Test recovery for a locked-out pilot user

    Simulate a lost phone with one pilot account and walk through the recovery path the organization intends to use, whether that is an administrator resetting the second factor, a backup method, or a helpdesk procedure. Record who is allowed to perform the reset, how identity is confirmed before the reset, and how long the user waits in practice. The step is done when the pilot user is back in the system through the documented path and the team has written the procedure down, so helpdesk staff can follow it without the original author present.

  5. Review enrollment and fix gaps before widening

    Before extending the requirement, the administrator reviews which pilot and candidate users have not enrolled, which have repeated prompts, and whether session timeouts trigger the 2FA prompt more often than expected. Check the user list and session behavior against the version documentation, and note any integration, such as API keys or scripts that sign in as a user, that will break under the new requirement. The step is done when the list of open issues is empty or each item has an owner and a decision.

  6. Extend the requirement to all internal users

    The administrator applies the requirement to all internal employee accounts in one planned change, with the helpdesk ready and the recovery procedure from the earlier test posted for staff. Send users clear instructions on enrolling before the change takes effect, and schedule the change outside peak work hours if the team can choose. The step is done when a review of the user list shows every internal account either enrolled or flagged for follow-up, and the helpdesk has confirmed it received the first recovery requests.

  7. Decide portal account treatment separately

    Portal users such as customers and vendors are a different population with different risks, so decide on their 2FA requirement as a separate change with its own owner, enrollment process and support path. Confirm with the documentation for your version whether the setting applies to portal accounts, and test enrollment for at least one portal account before any wider change. The step is done when the organization has a written decision on portal accounts, backed by a test result, and the team knows which account types the internal policy does and does not cover.

How 2FA interacts with API keys and single sign-on

Interactive two-factor checks protect browser sign-in. They do not protect integrations that call Odoo with an API key, because those clients authenticate with the key alone and never see a one-time code. For that reason, the API key becomes the control you have to protect. Enforcing 2FA for every user does not reduce the risk from a leaked key. Before go-live, list every integration that uses a key, the account each key belongs to, and the business owner who can approve changes. Then set a rotation schedule, limit each key to the access the integration needs, and confirm that key use appears in your logs. Confirm too whether the account behind each key is also subject to your 2FA policy, since that determines whether a compromised browser login can create a key in the first place.

Odoo documents sign-in through LDAP, Google Sign-In, Microsoft Azure OAuth and Facebook sign-in. With an external identity provider, the second factor is often enforced there rather than in Odoo. Treat that as a design decision to verify, not an assumption. For each sign-in method in use, confirm three things: where the second factor is enforced, whether Odoo still shows its own 2FA prompt after the identity provider has authenticated the user, and how the identity provider's MFA policy interacts with Odoo's setting. A user who signs in through an identity provider that already requires MFA may or may not see a second Odoo prompt, depending on your version and configuration, so test this with a sample account of each type. Also decide what happens to accounts that bypass the identity provider, such as local administrator accounts, which may still rely only on Odoo's own factor.

How a sign-in request moves through password, 2FA and SSO checks

The sign-in path starts in the browser, passes the reverse proxy, and reaches the Odoo server, which routes the request to password sign-in or to an external provider such as LDAP or OAuth. Where policy requires a second factor, the Odoo server checks it before granting a session. API requests carrying an API key follow a separate branch, and locked-out users go to an administrator recovery path. Check at each boundary which control is enforced, and confirm the behavior in your own environment before rollout.

Sign-in paths and the controls enforced at each trust boundary.

Lockout recovery and the risks of weak enrollment

Two-factor authentication fails in operations more often than in design. The cards below cover the lockout, enrollment and monitoring gaps that appear once 2FA is mandatory, and the controls to set before go-live. Each control should be rehearsed on a staging copy of the database before any user is asked to enroll.

Locked-out employees who lose their device

An employee who loses or replaces the phone holding their authenticator app cannot sign in until someone verifies them and resets enrollment. Name a recovery owner in IT or HR who handles these requests, and define the identity checks they must complete before any reset, such as confirming the request through the employee's manager or a known phone number. Ask the reader's team to confirm how Odoo's 2FA reset is performed for a given user and whether it requires administrator rights. Test the full procedure on staging before go-live.

Odoo user sign-in docs

Administrators who lock themselves out

The accounts that can reset 2FA for others are also subject to it, so an administrator can end up unable to recover the system. Keep at least two named administrator accounts enrolled on separate devices, and store their recovery material in a controlled vault rather than on personal devices. Set a rota for administrator accounts so that someone is always available to act. Confirm the recovery path with the vendor and rehearse it before enforcement is switched on.

Shared or reused recovery paths

When several people share a recovery mailbox, a shared phone or a common reset password, one compromised channel exposes many accounts. Each recovery route should be tied to one identity and logged, and shared accounts should be retired. Review which recovery channels exist for each user group, including portal and external contacts, and document who can trigger each one. Confirm with your security team that no recovery path bypasses the second factor entirely.

Enrollment that is never completed

Enforcement only protects accounts that have actually enrolled. Users who were created but never finished setup, dormant portal contacts and service accounts can remain in a state where the check is missing or unclear. Report unenrolled users on a regular schedule, set a deadline with the people who own each group, and decide in advance whether an account that misses the deadline is suspended. Include portal accounts in this report, since they are often created in bulk.

API keys that bypass the interactive check

API keys authenticate scripts and integrations without a second factor prompt, so enforcing 2FA on the web client does not govern them. Inventory every API key, assign each one to a named owner and a purpose, and revoke keys that no longer have a use. Confirm how the reader's Odoo version and integrations handle keys and whether any integration relies on interactive sign-in. Treat key issuance as part of the same access review as user enrollment.

Failed second-factor attempts in monitoring

Repeated wrong codes are a signal of password theft or an attacker who already has the first factor. Check whether failed second-factor attempts appear in the Odoo log lines your team collects, and feed them into the same brute-force monitoring used for password failures. Agree on the threshold and the response owner before go-live. Confirm the exact log messages in your Odoo version with a test login, since the format determines what your fail2ban filter can match.

Why session timeouts can trigger repeated 2FA prompts

When users are asked for a second factor again and again, the first suspect should be the session, not the people. A session that ends sooner than users expect forces a new sign-in, and a new sign-in forces a new code. Before you change any setting, list the likely causes in your own environment: a short session lifetime on the Odoo side, cookie settings applied by a reverse proxy, a load balancer that sends requests from one login to different Odoo worker processes, several browser tabs or hostnames that each hold their own session cookie, and time drift between the server and the phone running the authenticator app. Time drift matters because a code that is valid on the server window may already be stale on the device.

To separate a configuration problem from a user habit, reproduce the behavior on a test database that you have set to a fixed, known session length. Sign in with one account, using one browser and one hostname, and note the exact time of each prompt. Then repeat the test through the production proxy path, then with a second tab and a second hostname, and finally with a device whose clock is known to be correct. If the prompt appears at the same interval every time, the cause is in configuration or infrastructure. If it appears only when users switch tabs, change hostnames or leave a device idle, the habit is the trigger and training or session guidance is the fix.

Confirm the session timeout settings, the cookie and proxy header handling, and the load balancer's session affinity for your Odoo version and deployment method, using the Odoo documentation for that release, since defaults and option names can change between versions. Write down what you observed (timestamps, hostnames, browser, proxy path and clock source) before editing any configuration, so that a change can be compared against a known baseline and rolled back cleanly if it does not help.

What to confirm in your environment before you commit

Two-factor behavior in Odoo depends on the edition, release, hosting type and login methods you run, so these checks come before any policy is written. Each card names who should confirm the item, whether that is the vendor documentation, your identity team or your own test environment.

Edition and version that include your 2FA options

Confirm in the Odoo documentation for your release which two-factor options exist in your edition and which are present only in the Community or Enterprise code you run. Do not assume a setting in one major version exists in another. Write down the exact version number you plan to deploy, then check the option on a staging copy of that version before the policy depends on it. Your own test environment is the final authority here.

Odoo support docs

Authenticator apps your staff can use

Ask your identity or helpdesk team which authenticator apps are approved on managed devices and personal phones, and whether any staff use hardware keys. Odoo's two-factor flow relies on time-based one-time codes, so confirm during a test enrollment that each approved app generates codes Odoo accepts. Record the enrollment steps staff will see, since helpdesk tickets for lost phones will follow the same path.

Portal enforcement, native or custom

Confirm with the Odoo documentation whether your release can require two-factor for portal accounts without custom code. If it cannot, the work to enforce it becomes a custom module that must be reviewed and maintained through upgrades. Your test environment should show whether portal users can reach the portal without completing a second factor, because that gap is the usual failure.

Behavior with each sign-in method

List every sign-in path in use, such as local passwords, LDAP, Google Sign-In or Microsoft Azure OAuth, and test how two-factor applies to each one. Your identity team should confirm whether the external provider already enforces its own second factor and whether Odoo prompts again. Confirm how API keys interact with the login flow, since an API key does not pass through the interactive prompt.

LDAP sign-in docs

Support window for your release

Check how long your Odoo release receives standard support, which covers security updates. Odoo 19.0 standard support runs until September 2028, and Odoo 18.0 until September 2027. Odoo 17.0 standard support ended in September 2026, so a deployment on that version has no standard security coverage. Confirm the window on the vendor's support page and plan your upgrade before it closes, since 2FA behavior can change between releases.

Support windows

Hosting type and what you can configure

Confirm whether your deployment runs on Odoo Online, Odoo.sh or on-premise, because the hosting type affects which plan and settings are available to you. Odoo's pricing page states that only the Custom plan can be hosted on Odoo.sh or on-premise, so check your subscription before planning server-side settings. On-premise installs give you control of the server and proxy, while hosted options may limit it. Ask the vendor which 2FA settings you can change on your hosting type.

Odoo pricing

Questions buyers ask about 2FA rollout in Odoo

How much effort does a two-factor authentication rollout in Odoo take?

Effort depends mostly on who must enroll, how many sign-in paths exist, and how recovery works. A rollout for a small group of internal users with one sign-in method is far simpler than one covering portal customers, LDAP or Azure sign-in, and several administrator roles. The main drivers are the user count, the number of sign-in methods that must be checked against the 2FA policy, the size of the portal population, and the recovery procedure your help desk will follow when a user loses their device. Ask for a written scope that lists each of these, because the effort follows from that list rather than from the Odoo setting itself.

Can an internal team enforce 2FA in Odoo without a partner?

Yes, many internal teams can enable and test 2FA themselves, because Odoo documents two-factor authentication as a built-in feature. The harder part is the surrounding work: deciding which accounts must enroll, testing every sign-in path (direct login, LDAP, Google, Microsoft Azure OAuth and any proxy or SSO layer), writing the lockout recovery steps, and verifying that the change did not disrupt integrations. A partner is most useful when the team lacks staff who can test these paths on a copy of the database, or when auditors will ask for documented evidence. Decide which parts you will own before you choose.

What does the client need to provide for a 2FA project?

The client needs a named identity owner who decides the policy, administrator access to the Odoo instance and its reverse proxy, and a test database that mirrors production. You also need a current user list that separates employees, portal contacts and service accounts, plus a list of every sign-in method in use. Someone must approve the recovery procedure, including who can reset a second factor and how that person verifies identity. Without these inputs, the work stalls at the first question about who must enroll and how locked-out users get back in.

How long does a 2FA pilot take, and what sets the pace?

The pace of a pilot is set by decisions and testing, not by the configuration step. Timelines depend on how quickly the identity owner signs off on the policy, how many sign-in paths must be tested on a database copy, how many users are in the pilot group, and whether your help desk has agreed on recovery steps before go-live. No duration is fixed by Odoo's documentation, so ask any partner to give a timeline built from your written scope and to show which steps depend on your staff. Agree on the pilot exit criteria before the pilot starts.

Does two-factor authentication cover Odoo API keys?

No. Two-factor authentication protects interactive sign-in to the web client, and it does not replace API key management. API keys are credentials that scripts and integrations use, so they need their own controls: a named owner for each key, a documented purpose, limited lifetime, rotation, and removal when an integration is retired. Check the Odoo API documentation for how keys are created and revoked in your version, and review which user each key belongs to, because a key inherits that user's access rights.

Can an Odoo partner certify that our 2FA setup is compliant?

No. An implementation partner can configure controls, prepare evidence and test how the controls behave, but only an independent auditor or certification body can issue an audit report, attestation or certification. DeployOpen prepares systems, controls and evidence for compliance assessments and does not issue audit reports or certifications. Ask your auditor early which evidence they expect for authentication controls, such as policy settings, enrollment records, recovery logs and test results, so the rollout produces that evidence from the start.

Why do sessions trigger repeated 2FA prompts, and what should we check?

Repeated prompts usually come from session lifetime settings, cookies that do not persist between requests, or a reverse proxy that drops or rewrites session cookies. Check how long Odoo sessions last, whether the proxy forwards the headers Odoo expects, and whether users switch between the hostname that enrolled their device and another one. Test the same flow on the staging copy with a clean browser profile before changing the policy in production, and record which settings were changed so the team can roll them back.

How DeployOpen scopes and delivers 2FA enforcement for Odoo

DeployOpen approaches enforcing two-factor authentication in Odoo as a scoped change to your own self-hosted instance, starting with which user types must comply and how their accounts are used today. We build the policy, test it with real login paths including portal and API users, and hand over a documented procedure your administrators can run without us.

How we scope

  • Inventory which user groups, employees and portal accounts must use two-factor authentication, and which are exempt
  • Map existing API key use, integration accounts and any SSO or LDAP sign-in that changes how the second factor applies
  • Agree the scope, deliverables and timeline in writing before work starts, since most engagements are fixed-scope

How we build

  • Configure two-factor enforcement for the agreed user groups on a staging copy of your Odoo database first
  • Test each sign-in path: web login, portal login, session timeout prompts, authenticator app enrollment and recovery
  • Confirm how API keys and integration accounts behave under the policy and adjust the design where they break

How we hand over

  • Deliver a written runbook covering enrollment, locked-out user recovery and the admin steps for resetting a second factor
  • Document the tested configuration, the user groups in scope and the known session timeout behavior for your team
  • Walk your administrators through the procedure and the evidence they can show security or compliance reviewers

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover
  • Re-test two-factor behavior when you upgrade Odoo, change identity providers or add new user groups
  • Confirm with Odoo and your own environment which two-factor features apply to your edition and hosting type

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.