evgeny-gridasov / openvpn-otp

OpenVPN OTP token support plugin
GNU General Public License v3.0
279 stars 74 forks source link

Scratch codes #25

Open ohmer1 opened 6 years ago

ohmer1 commented 6 years ago

Hello,

Is there a way to support scratch codes generated by google authenticator?

calve commented 6 years ago

AFAIU crash code are pregenerated HOTP. Those are supported by openvpn-otp.

ohmer1 commented 6 years ago

I tried the generated codes but they are not working. I don't know if this is related, but the generated scratch codes have 8 digits but normal codes have only 6.

I use Google Authenticator to generate OTP keys: google-authenticator --time-based --disallow-reuse --force --rate-limit=3 --rate-time=30 --window-size=17 --label=${USER}@sdomain.tld --secret=/root/ovpn2fa_secret

calve commented 6 years ago

Looks like you can configure the lenght of codes with the totp_digits param (see readme) but it might apply to both HOTP and TOTP https://github.com/evgeny-gridasov/openvpn-otp/blob/master/src/otp.c#L619