Duo can authenticate using HOTP - Hash(message authentication code)-based One-Time Password.
But it has some proprietary covers over the OATH (Initiative for Open Authentication) standard.
simonseo/nyuad-spammer has code to work around this.
duo.py
is largely copied from there
also see duo.py -h
or the doc string of duo.py
https://api-e4c9863e.duosecurity.com/frame/qr?value=c53Xoof7cFSOHGxtm69f-YXBpLWU0Yzk4NjNlLmR1b3NlY3VyaXR5LmNvbQ
./duo.py new 'https://URL-OF-IMAGE'
to register./duo.py next
for future authenticationconsider adding binding in sxkd
, xbindkeys
, etc for
duo.py next -s ~/secure/myinstitution_duo.json | xclip -i
secret.json
file is not encrypted! Be careful where you store it (see -s
switch).next
calls w/out passing on to duo, you'll leave the validation window and duo will not authenticate.pip install -r requirements.txt # pyotp docopt requests
./duo.py -h
testing is limited.
python -m doctest duo.py
duo.py
is specific to duo's HOTP.
For time based one time passwords (Google Authenticator, Microsoft Authenticator), look at oath-toolkit
KEY=$(zbarimg /path/to/qr-image.png)
oathtool --totp --base32 $KEY