use of com.warrenstrange.googleauth.IGoogleAuthenticator in project cas by apereo.
the class GoogleAuthenticatorAuthenticationEventExecutionPlanConfiguration method googleAuthenticatorInstance.
@Bean
public IGoogleAuthenticator googleAuthenticatorInstance() {
final GAuthMultifactorProperties gauth = casProperties.getAuthn().getMfa().getGauth();
final GoogleAuthenticatorConfig.GoogleAuthenticatorConfigBuilder bldr = new GoogleAuthenticatorConfig.GoogleAuthenticatorConfigBuilder();
bldr.setCodeDigits(gauth.getCodeDigits());
bldr.setTimeStepSizeInMillis(TimeUnit.SECONDS.toMillis(gauth.getTimeStepSize()));
bldr.setWindowSize(gauth.getWindowSize());
bldr.setKeyRepresentation(KeyRepresentation.BASE32);
return new GoogleAuthenticator(bldr.build());
}
Aggregations