Skip to content

Latest commit

 

History

History
16 lines (15 loc) · 622 Bytes

2FA.md

File metadata and controls

16 lines (15 loc) · 622 Bytes

Setting up 2FA for NextDNS API

  1. If 2FA is already enabled on your account, please disable it. (It will be re-enabled later.)
  2. Install a time-based authenticator such as Authy or Google Authenticator.
  3. Visit 2FA settings
  4. Enable 2FA and copy the text below the QR code.
  5. Save this as a variable, such as qrbase
  6. Install pyotp using: pip install pyotp
  7. Use it like so:
from nextdnsapi.api import *
import pyotp

totp = pyotp.TOTP(qrbase)
totp_code = totp.now()
print(totp_code)
header = account.login("[email protected]", "password123", totp_code)