One-Time Passwords (OTP) - Example
pip install pyotpServer-Side Setup
import pyotp
base32secret = pyotp.random_base32()
print('Secret:', base32secret)
totp_uri = pyotp.totp.TOTP(base32secret).provisioning_uri(
"[email protected]",
issuer_name="Secure App")
print(totp_uri)Secret: S3K3TPI5MYA2M67V
otpauth://totp/Secure%20App:alice%40google.com?secret=S3K3TPI5MYA2M67V&issuer=Secure%20AppClient-Side Setup
Working Example

Last updated