Search in sources :

Example 1 with IGoogleAuthenticator

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());
}
Also used : IGoogleAuthenticator(com.warrenstrange.googleauth.IGoogleAuthenticator) GoogleAuthenticator(com.warrenstrange.googleauth.GoogleAuthenticator) GoogleAuthenticatorConfig(com.warrenstrange.googleauth.GoogleAuthenticatorConfig) GAuthMultifactorProperties(org.apereo.cas.configuration.model.support.mfa.GAuthMultifactorProperties) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

GoogleAuthenticator (com.warrenstrange.googleauth.GoogleAuthenticator)1 GoogleAuthenticatorConfig (com.warrenstrange.googleauth.GoogleAuthenticatorConfig)1 IGoogleAuthenticator (com.warrenstrange.googleauth.IGoogleAuthenticator)1 GAuthMultifactorProperties (org.apereo.cas.configuration.model.support.mfa.GAuthMultifactorProperties)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1