Change default expiry period of “Pyotp”


Change default expiry period of “Pyotp”



I'm using Pyotp for generating OTP. Default expiry of this token is 30sec. How can I change the default expiry to some 60 seconds?
This is the simple code I'm using.


secret = pyotp.random_base32()
totp = pyotp.TOTP(secret)
otp = totp.now()




1 Answer
1



Here a try , It was worked for me:


totp = pyotp.TOTP(secret, interval=60)






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Rothschild family

Cinema of Italy