<AuthBy SQLTOTP> authentication module
detects replay and brute-force attacks. It supports optional PIN, also
known as static password, for 2 factor authentication when the user
prefixes their static password before the TOTP one-time password.<AuthBy SQLTOTP> supports by default PAP,
EAP-TOP and EAP-GTC. CHAP, MSCHAP and MSCHAPv2 are supported but need to
be enabled with AuthenProto
configuration parameter. EAP-MSCHAP-V2 is supported as MSCHAPv2 when ConvertedFromEAPMSCHAPV2
is enabled. The CHAP methods do not support detection of bad PIN
values.<AuthBy SQLTOTP> supports the same
parameters as <AuthBy xxxxxx>. For more
information, see Section 3.32. <AuthBy xxxxxx>. It supports also
all the common SQL configuration parameters. For more information about
the SQL configuration parameters, see Section 3.8. SQL configuration.AuthSelect is an SQL query that fetches
TOTP token data from the SQL database. AuthSelect is
expected to return a number of fields that describe the token.Require2Factor is not set to disabled.DefaultDigits is be
used.UpdateQuery.SHA1, SHA256 and
SHA512.TimeStep configuration parameter if the
value is 0 or NULL.TimeStepOrigin
configuration parameter if the value is NULL.%0 which is
SQL quoted when used in AuthSelect and unmodified
when used with AuthSelectParam. goodies/totp.sql. The default is:select secret, active, pin, digits, bad_logins, unix_timestamp(accessed), last_timestep from totpkeys where username=%0
UpdateQuery is an SQL query that updates
the TOTP token data in the SQL database. After a successful or failed
authentication it will be passed the bad login count in
%0, the user name in %1 and last TOTP
timestep in %2. The default works with the sample
database schema provided in goodies/totp.sql. The
default is:update totpkeys set accessed=now(), bad_logins=%0, last_timestamp=%2 where username=%1
Require2Factor is not
set to disabled, then the user must provide their static password as a
prefix to their one-time password. The correct static password is returned
by AuthSelect. If the user provides a static password
prefix, then the static password is always checked regardless of
Require2Factor setting.# We use PAP, EAP-OTP or EAP-GTC and can use encrypted PIN EncryptedPIN
DefaultDigits specifies the number of
one-time password digits to use if the user record does not define digits.
Defaults to 6. Minimum allowed is 4.MaxBadLogins specifies how many
consecutive bad PINs or bad OTP codes will be tolerated in the last
BadLoginWindow seconds. If more than
MaxBadLogins bad authentication attempts occurs and
if the last one is within the last BadLoginWindow
seconds, the authentication attempt will be rejected. The user must wait
at least BadLoginWindow seconds before attempting to
authenticate again. MaxBadLogins defaults to
10.UpdateQuery and
AuthSelect.MaxBadLogins have occurred.TimeStep is the size of the time step in
seconds to use if the user record does not define time step. Defaults to
30 seconds, the value recommended by the TOTP specification.TimeStepOrigin the Unix epoch time of the
first time step to use if the user record does not define the origin.
Defaults to 0 seconds (Jan 1, 1970), the value recommended by the TOTP
specification.