OTP get seed && verify token
This commit is contained in:
parent
de4469d148
commit
b73d19fef7
1 changed files with 5 additions and 2 deletions
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue