Search in sources :

Example 1 with TOTPAuthenticator

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;
}
Also used : TOTPAuthenticator(com.zimbra.common.auth.twofactor.TOTPAuthenticator) TwoFactorOptions(com.zimbra.common.auth.twofactor.TwoFactorOptions) AuthenticatorConfig(com.zimbra.common.auth.twofactor.AuthenticatorConfig) ZMountpoint(com.zimbra.client.ZMountpoint)

Aggregations

ZMountpoint (com.zimbra.client.ZMountpoint)1 AuthenticatorConfig (com.zimbra.common.auth.twofactor.AuthenticatorConfig)1 TOTPAuthenticator (com.zimbra.common.auth.twofactor.TOTPAuthenticator)1 TwoFactorOptions (com.zimbra.common.auth.twofactor.TwoFactorOptions)1