2020-11-27 15:47:59 +07:00
|
|
|
=========================
|
2024-07-17 22:14:30 +07:00
|
|
|
Two-factor authentication
|
2020-11-27 15:47:59 +07:00
|
|
|
=========================
|
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
.. |2fa| replace:: :abbr:`2FA (two-factor authentication)`
|
|
|
|
.. |QR| replace:: :abbr:`QR (Quick Response)` code
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
*Two-factor authentication (2FA)* is a way to improve security, and prevent unauthorized persons
|
|
|
|
from accessing user accounts.
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
Practically, |2fa| means storing a secret inside an *authenticator*, usually on a mobile phone, and
|
|
|
|
exchanging a code from the authenticator when trying to log in.
|
|
|
|
|
|
|
|
This means an unauthorized user would need to guess the account password *and* have access to the
|
|
|
|
authenticator, which is a more difficult proposition.
|
2020-11-27 15:47:59 +07:00
|
|
|
|
|
|
|
Requirements
|
|
|
|
============
|
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
.. important::
|
|
|
|
These lists are just examples. They are **not** endorsements of any specific software.
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
Phone-based authenticators are the easiest and most commonly used. Examples include:
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
- `Authy <https://authy.com/>`_
|
|
|
|
- `FreeOTP <https://freeotp.github.io/>`_
|
|
|
|
- `Google Authenticator <https://support.google.com/accounts/answer/1066447?hl=en>`_
|
|
|
|
- `LastPass Authenticator <https://lastpass.com/auth/>`_
|
|
|
|
- `Microsoft Authenticator
|
|
|
|
<https://www.microsoft.com/en-gb/account/authenticator?cmp=h66ftb_42hbak>`_
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
Password managers are another option. Common examples include:
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
- `1Password <https://support.1password.com/one-time-passwords/>`_
|
|
|
|
- `Bitwarden <https://bitwarden.com/help/article/authenticator-keys/>`_,
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
.. note::
|
|
|
|
The remainder of this document uses Google Authenticator as an example, as it is one of the most
|
|
|
|
commonly used. This is **not** an endorsement of the product.
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
Two-factor authentication setup
|
|
|
|
===============================
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
After selecting an authenticator, log in to Odoo, then click the profile avatar in the upper-right
|
|
|
|
corner, and select :guilabel:`My Profile` from the resulting drop-down menu.
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
Click the :guilabel:`Account Security` tab, then slide the :guilabel:`Two-Factor Authentication`
|
|
|
|
toggle to *active*.
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
.. figure:: 2fa/account-security.png
|
2020-11-27 15:47:59 +07:00
|
|
|
:align: center
|
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
This generates a :guilabel:`Security Control` pop-up window that requires password confirmation to
|
|
|
|
continue. Enter the appropriate password, then click :guilabel:`Confirm Password`. Next, a
|
|
|
|
:guilabel:`Two-Factor Authentication Activation` pop-up window appears, with a |QR|.
|
2020-11-27 15:47:59 +07:00
|
|
|
|
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
.. figure:: 2fa/qr-code.png
|
2020-11-27 15:47:59 +07:00
|
|
|
:align: center
|
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
Using the desired authenticator application, scan the |QR| when prompted.
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
.. tip::
|
|
|
|
If scanning the screen is not possible (e.g. the setup is being completed on the *same* device as
|
|
|
|
the authenticator application), clicking the provided :guilabel:`Cannot scan it?` link, or
|
|
|
|
copying the secret to manually set up the authenticator, is an alternative.
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
.. figure:: 2fa/secret-visible.png
|
2020-11-27 15:47:59 +07:00
|
|
|
:align: center
|
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
.. figure:: 2fa/input-secret.png
|
2020-11-27 15:47:59 +07:00
|
|
|
:align: center
|
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
Afterwards, the authenticator should display a *verification code*.
|
2020-11-27 15:47:59 +07:00
|
|
|
|
[MOV] content/*: move resource files into their related page's directory
Since odoo/documentation#903, the guideline for the location of new
resource (images, downloadable files, RST includes...) files is to place
those inside the directory of the RST page that references them.
For example, if `doc1.rst` has a reference to `image.png` and to
`download.zip`, the file structure should look like this:
├── parent_doc/
│ └── doc1/
│ │ └── image.png
│ │ └── download.zip
│ └── doc1.rst
│ └── doc2.rst
├── parent_doc.rst
Before this commit, most of the resource files were still located inside
'media' directories holding all the resource files referenced by RST
pages located at the same level as these directories. In the example
above, a single 'media' directory would hold all the resource files
referenced by both `doc1.rst` and `doc2.rst`. Doing so prevented us from
figuring out easily which resource file was referenced by which RST page
and, thus, lead to unused resource files piling up in the repository. It
also made it more complicated to define codeowners regex rules because a
team could not simply be assigned to `/some_page.*` but needed to be
assigned to both `/some_page\.rst` and to the location of 'media'.
In order to help new content writers figure out the guideline when
taking examples from other RST pages, this commit retroactively applies
the guideline to existing resource files and 'media' directories. The
left-over resource files that are not referenced by any RST page are
removed.
task-2497965
Part-of: odoo/documentation#2068
2022-05-20 16:54:32 +07:00
|
|
|
.. figure:: 2fa/authenticator.png
|
2020-11-27 15:47:59 +07:00
|
|
|
:align: center
|
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
Enter the code into the :guilabel:`Verification Code` field, then click :guilabel:`Activate`.
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
.. figure:: 2fa/2fa-enabled.png
|
2020-11-27 15:47:59 +07:00
|
|
|
:align: center
|
|
|
|
|
|
|
|
Logging in
|
|
|
|
==========
|
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
To confirm |2fa| setup is complete, log out of Odoo.
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
On the login page, input the username and password, then click :guilabel:`Log in`. On the
|
|
|
|
:guilabel:`Two-factor Authentication` page, input the code provided by the chosen authenticator in
|
|
|
|
the :guilabel:`Authentication Code` field, then click :guilabel:`Log in`.
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
.. image:: 2fa/2fa-login.png
|
2020-11-27 15:47:59 +07:00
|
|
|
:align: center
|
2024-07-17 22:14:30 +07:00
|
|
|
:alt: The login page with 2fa enabled.
|
|
|
|
|
|
|
|
.. danger::
|
|
|
|
If a user loses access to their authenticator, an administrator **must** deactivate |2fa| on the
|
|
|
|
account before the user can log in.
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
Enforce two-factor authentication
|
|
|
|
=================================
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
To enforce the use of |2fa| for all users, first navigate to :menuselection:`Main Odoo Dashboard -->
|
|
|
|
Apps`. Remove the :guilabel:`Apps` filter from the :guilabel:`Search...` bar, then search for `2FA
|
|
|
|
by mail`.
|
|
|
|
|
|
|
|
Click :guilabel:`Install` on the Kanban card for the :guilabel:`2FA by mail` module.
|
|
|
|
|
|
|
|
.. image:: 2fa/2FA-by-mail.png
|
|
|
|
:align: center
|
|
|
|
:alt: The 2FA by mail module in the Apps directory.
|
|
|
|
|
|
|
|
After installation is complete, go to :guilabel:`Settings app: Permissions`. Tick the checkbox
|
|
|
|
labeled, :guilabel:`Enforce two-factor authentication`. Then, use the radio buttons to choose
|
|
|
|
whether to apply this setting to :guilabel:`Employees only`, or :guilabel:`All users`.
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
Selecting :guilabel:`All users` applies the setting to portal users, in addition to employees.
|
|
|
|
|
|
|
|
.. image:: 2fa/enforce-settings.png
|
|
|
|
:align: center
|
|
|
|
:alt: The enforce two factor setting in the Settings application.
|
2020-11-27 15:47:59 +07:00
|
|
|
|
2024-07-17 22:14:30 +07:00
|
|
|
Click :guilabel:`Save` to commit any unsaved changes.
|