django-two-factor-auth
django-two-factor-auth copied to clipboard
Question : Totp tolerance change
Hi , Want to make the TOTP tolerance value to 0, to make sure the current token is only valid. Any setting is there to change the tolerance value for all users? need help
I have no idea why you're tagging me. Please don't do that, it's rude. I'm not your personal support assistant.
same as above + I don't even know what are you talking about.
@vishalpandeyvip
https://django-two-factor-auth.readthedocs.io/en/stable/class-reference.html?highlight=tolerance#django_otp.plugins.otp_totp.models.TOTPDevice
Am asking , do you have any idea to change the value of the tolerance value for TOTP device which is default 1. Is there any seating to modify it for all users ?
FYI
key CharField: A hex-encoded secret key of up to 40 bytes. (Default: 20 random bytes)
step PositiveSmallIntegerField: The time step in seconds. (Default: 30)
t0 BigIntegerField: The Unix time at which to begin counting steps. (Default: 0)
digits PositiveSmallIntegerField: The number of digits to expect in a token (6 or 8). (Default: 6)
tolerance PositiveSmallIntegerField: The number of time steps in the past or future to allow. For example, if this is 1, we’ll accept any of three tokens: the current one, the previous one, and the next one. (Default: 1)
You already have done enough research. you can just use the Model Class mentioned, and pass the value of tolerance whatever you want. pass it as an argument. For Example :
from django_otp.plugins.otp_totp import TOTPDevice
variable = TOTPDevice.objects.create(tolerance=10)
Am asking any global setting to change it to 0,for all users ?