use of com.zimbra.common.auth.twofactor.TOTPAuthenticator in project zm-mailbox by Zimbra.
the class TestUtil method getDefaultAuthenticator.
public static TOTPAuthenticator getDefaultAuthenticator() {
final int WINDOW_SIZE = 30;
final TwoFactorOptions.HashAlgorithm HASH_ALGORITHM = TwoFactorOptions.HashAlgorithm.SHA1;
final TwoFactorOptions.CodeLength NUM_CODE_DIGITS = TwoFactorOptions.CodeLength.SIX;
AuthenticatorConfig config = new AuthenticatorConfig();
config.setHashAlgorithm(HASH_ALGORITHM);
config.setNumCodeDigits(NUM_CODE_DIGITS);
config.setWindowSize(WINDOW_SIZE);
TOTPAuthenticator auth = new TOTPAuthenticator(config);
return auth;
}
Aggregations