Debian Codegraph @

docs/mfa/configuration.rst

raw
1 Configuration
2 =============
3
4 Available settings:
5
6 ``MFA_ADAPTER`` (default: ``"allauth.mfa.adapter.DefaultMFAAdapter"``)
7 Specifies the adapter class to use, allowing you to alter certain
8 default behavior.
9
10 ``MFA_ALLOW_UNVERIFIED_EMAIL`` (default: ``False``)
11 By default, an account that has an unverified email address is not allowed to
12 turn on MFA. Additionally, accounts that have MFA turned on cannot add a new
13 (unverified) email address. The rationale is that if this were allowed, it
14 would allow an attacker to signup without verifying and then turn on MFA to
15 prevent the real owner of the account from ever gaining access. If the risk
16 of this scenario is manageable for your project, you can allow unverified email
17 address in combination with MFA by changing this setting.
18
19 ``MFA_FORMS``
20 Used to override forms. Defaults to::
21
22 MFA_FORMS = {
23 'authenticate': 'allauth.mfa.base.forms.AuthenticateForm',
24 'reauthenticate': 'allauth.mfa.base.forms.AuthenticateForm',
25 'activate_totp': 'allauth.mfa.totp.forms.ActivateTOTPForm',
26 'deactivate_totp': 'allauth.mfa.totp.forms.DeactivateTOTPForm',
27 'generate_recovery_codes': 'allauth.mfa.recovery_codes.forms.GenerateRecoveryCodesForm',
28 }
29
30 ``MFA_PASSKEY_LOGIN_ENABLED`` (default: ``False``)
31 Whether or not end users can login using a (WebAuthn) passkey. Note that for
32 this to be enabled, you also need to add ``"webauthn"`` to
33 ``MFA_SUPPORTED_TYPES``.
34
35 ``MFA_PASSKEY_SIGNUP_ENABLED`` (default: ``False``)
36 Whether or not end users can signup using a (WebAuthn) passkey. Note that for
37 this to be enabled, you need to add ``"webauthn"`` to ``MFA_SUPPORTED_TYPES``,
38 require mandatory email verification and have
39 ``ACCOUNT_EMAIL_VERIFICATION_BY_CODE_ENABLED`` set to ``True``.
40
41 ``MFA_RECOVERY_CODE_COUNT`` (default: ``10``)
42 The number of recovery codes.
43
44 ``MFA_RECOVERY_CODE_DIGITS`` (default: ``8``)
45 The number of digits of each recovery code.
46
47 ``MFA_RECOVERY_CODES_SHOW_ONCE`` (default: ``False``)
48 Whether or not recovery codes are shown only once.
49
50 ``MFA_SUPPORTED_TYPES`` (default: ``[["recovery_codes", "totp"]``)
51 The authenticator types that end users are able to setup. Allowed
52 types are: ``"recovery_codes"``, ``"totp"``, and ``"webauthn"``. The
53 latter is disabled by default.
54
55 ``MFA_TOTP_PERIOD`` (default: ``30``)
56 The period that a TOTP code will be valid for, in seconds.
57
58 ``MFA_TOTP_TOLERANCE`` (default: ``0``)
59 The number of time steps in the past or future to allow. Lower values are more secure, but more likely to fail due to clock drift.
60
61 ``MFA_TOTP_DIGITS`` (default: ``6``)
62 The number of digits for TOTP codes.
63
64 ``MFA_TOTP_ISSUER`` (default: ``""``)
65 The issuer (appearing in the TOTP QR code).
66
67 ``MFA_WEBAUTHN_ALLOW_INSECURE_ORIGIN`` (default: ``False``)
68 The WebAuthn uses the ``fido2`` package, and versions up to including version
69 1.1.3 do not regard localhost as a secure origin, which is problematic during
70 local development and testing. To work around that, you can use this setting.
71 Only use this for development, never on production. See commit ``8b979313``
72 over at ``fido2``.
73
74 ``MFA_TRUST_ENABLED`` (default: ``False``)
75 Enables the "Trust this browser?" functionality, which presents users with MFA
76 enabled the choice to trust their browser allowing them to skip authenticating
77 per MFA on each login. This is implemented by handing out a special trust
78 cookie.
79
80 ``MFA_TRUST_COOKIE_AGE`` (default: ``timedelta(days=14)``)
81 Specifies the period (in seconds, or ``timedelta``) during which MFA is
82 skipped.
83
84 ``MFA_TRUST_COOKIE_NAME`` (default: ``"mfa_trusted"``)
85 The name of the trust cookie.
86
87 ``MFA_TRUST_COOKIE_DOMAIN`` (default: ``settings.SESSION_COOKIE_DOMAIN``)
88 The domain of the trust cookie.
89
90 ``MFA_TRUST_COOKIE_HTTPONLY`` (default: ``settings.SESSION_COOKIE_HTTPONLY``)
91 Whether or not the trust cookie is HTTP only.
92
93 ``MFA_TRUST_COOKIE_PATH`` (default: ``settings.SESSION_COOKIE_PATH``)
94 The path set on the trust cookie.
95
96 ``MFA_TRUST_COOKIE_SAMESITE`` (default: ``settings.SESSION_COOKIE_SAMESITE``)
97 The value of the SameSite flag on the trust cookie.
98
99 ``MFA_TRUST_COOKIE_SECURE`` (default: ``settings.SESSION_COOKIE_SECURE``)
100 Whether to use a secure cookie for the trust cookie.