Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question : Totp tolerance change #618

Open
PriyatamNayak opened this issue Apr 13, 2023 · 5 comments
Open

Question : Totp tolerance change #618

PriyatamNayak opened this issue Apr 13, 2023 · 5 comments

Comments

@PriyatamNayak
Copy link

PriyatamNayak commented Apr 13, 2023

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

@matthiask
Copy link
Member

I have no idea why you're tagging me. Please don't do that, it's rude. I'm not your personal support assistant.

@vishalpandeynits
Copy link
Member

same as above + I don't even know what are you talking about.

@PriyatamNayak
Copy link
Author

@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)

@vishalpandeynits
Copy link
Member

vishalpandeynits commented Apr 14, 2023

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)

@PriyatamNayak
Copy link
Author

Am asking any global setting to change it to 0,for all users ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants