Google Authenticator Verification iRule (TMOS v11.1+ optimized)
Updated Jun 06, 2023
Version 2.0Was this article helpful?
another solution is to create the range of allowed clock in RULE_INIT
set static::ga_allowed_clock_skew_units 10
set static::ga_allowed_clock_range {0}
for {set i 1} {$i < $static::ga_allowed_clock_skew_units} {incr i} {
lappend static::ga_allowed_clock_range -$i
lappend static::ga_allowed_clock_range $i
}
then, use only one loop on this list:
foreach x $static::ga_allowed_clock_range {
...code...
}