From b73d19fef76ac4a0fbdd9e1a251d8853d762d0b1 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 26 Oct 2018 18:30:15 +0200 Subject: [PATCH] OTP get seed && verify token --- nameko1.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nameko1.py b/nameko1.py index 983acd0..efb37da 100644 --- a/nameko1.py +++ b/nameko1.py @@ -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"