OTP get seed && verify token

This commit is contained in:
Nico Schottelius 2018-10-26 18:30:15 +02:00
parent de4469d148
commit b73d19fef7
1 changed files with 5 additions and 2 deletions

View File

@ -86,10 +86,13 @@ class OTPSeed:
@timer(interval=10)
def auth(self):
seed = otp.get_seed("app1")
seed = self.otp.get_seed("app1")
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:
name = "otp"