OTP get seed && verify token

This commit is contained in:
Nico Schottelius 2018-10-26 18:30:15 +02:00
parent de4469d148
commit b73d19fef7

View file

@ -86,10 +86,13 @@ class OTPSeed:
@timer(interval=10) @timer(interval=10)
def auth(self): def auth(self):
seed = otp.get_seed("app1") seed = self.otp.get_seed("app1")
totp = pyotp.TOTP(seed) totp = pyotp.TOTP(seed)
token = totp.now()
print("seed / token: {} {}".format(seed, token)) res = self.otp.verify("app1", token)
print("seed / token / res {} {} {}".format(seed, token, res))
class OTPService: class OTPService:
name = "otp" name = "otp"