Change default expiry period of "Pyotp"
Asked Answered
I

1

6

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() 
Inwardly answered 2/7, 2018 at 10:21 Comment(0)
H
13

Here, give this a try, It did work for me.

totp = pyotp.TOTP(secret, interval=60)
Hoopen answered 2/7, 2018 at 10:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.