OTP is a simple cli tool that implemented in Golang to output the OTP code.
This project is using the lib from "github.com/creachadair/otp" as the HOTP (RFC 4226) and TOTP (RFC 6238) algorithms.
mkdir bin
go build -o bin/otp ./cmd/otp
cd bin
./otp --help
Usage: otp <command>
An OTP command tool
Flags:
--help Show context-sensitive help.
-D, --debug Enable debug mode
-V, --verbose Verbose mode.
-v, --version Print Version.
Commands:
get Get otp code.
Run "otp <command> --help" for more information on a command.
./otp get --secret <secret>
# make sure to remove "<>" with following
echo "<your password>\n`otp get -s <secret>`" | sudo openconnect -u <your username> https://<your vpn url with port> --passwd-on-stdin