From f0c96c1e1eca6c04257bcc45f208df808a53cc6b Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 28 Oct 2020 12:27:09 -0700 Subject: [PATCH] GUACAMOLE-1146: Take configured "totp-period" into account when generating tokens. --- .../guacamole/auth/totp/user/UserVerificationService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/UserVerificationService.java b/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/UserVerificationService.java index e0cd84b3d..cdf4071ad 100644 --- a/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/UserVerificationService.java +++ b/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/UserVerificationService.java @@ -271,7 +271,8 @@ public class UserVerificationService { // Get generator based on user's key and provided configuration TOTPGenerator totp = new TOTPGenerator(key.getSecret(), - confService.getMode(), confService.getDigits()); + confService.getMode(), confService.getDigits(), + TOTPGenerator.DEFAULT_START_TIME, confService.getPeriod()); // Verify provided TOTP against value produced by generator if ((code.equals(totp.generate()) || code.equals(totp.previous()))