Search in sources :

Example 1 with GoogleAuthenticator

use of com.warrenstrange.googleauth.GoogleAuthenticator in project cas by apereo.

the class JsonGoogleAuthenticatorTokenCredentialRepositoryTests method setup.

@Before
public void setup() {
    final GoogleAuthenticatorConfig.GoogleAuthenticatorConfigBuilder bldr = new GoogleAuthenticatorConfig.GoogleAuthenticatorConfigBuilder();
    this.google = new GoogleAuthenticator(bldr.build());
}
Also used : IGoogleAuthenticator(com.warrenstrange.googleauth.IGoogleAuthenticator) GoogleAuthenticator(com.warrenstrange.googleauth.GoogleAuthenticator) GoogleAuthenticatorConfig(com.warrenstrange.googleauth.GoogleAuthenticatorConfig) Before(org.junit.Before)

Example 2 with GoogleAuthenticator

use of com.warrenstrange.googleauth.GoogleAuthenticator 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)2 GoogleAuthenticatorConfig (com.warrenstrange.googleauth.GoogleAuthenticatorConfig)2 IGoogleAuthenticator (com.warrenstrange.googleauth.IGoogleAuthenticator)2 GAuthMultifactorProperties (org.apereo.cas.configuration.model.support.mfa.GAuthMultifactorProperties)1 Before (org.junit.Before)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1