Google Authenticator Authentication

Google Authenticator generates 2-step verification codes on your phone. With 2-step verification signing in will require a code generated by the Google Authenticator app in addition to primary authentication. Learn more about the topic here.

Note that the functionality presented here should also be compatible with the likes of LastPass Authenticator, etc.

Configuration

Support is enabled by including the following module in the overlay:

1
2
3
4
5
<dependency>
    <groupId>org.apereo.cas</groupId>
    <artifactId>cas-server-support-gauth</artifactId>
    <version>${cas.version}</version>
</dependency>
1
implementation "org.apereo.cas:cas-server-support-gauth:${project.'cas.version'}"
1
2
3
4
5
6
7
8
9
dependencyManagement {
    imports {
        mavenBom "org.apereo.cas:cas-server-support-bom:${project.'cas.version'}"
    }
}

dependencies {
    implementation "org.apereo.cas:cas-server-support-gauth"
}
1
2
3
4
5
6
dependencies {
    implementation enforcedPlatform("org.apereo.cas:cas-server-support-bom:${project.'cas.version'}")
    implementation platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)

    implementation "org.apereo.cas:cas-server-support-gauth"
}

The following settings and properties are available from the CAS configuration catalog:

The configuration settings listed below are tagged as Required in the CAS configuration metadata. This flag indicates that the presence of the setting may be needed to activate or affect the behavior of the CAS feature and generally should be reviewed, possibly owned and adjusted. If the setting is assigned a default value, you do not need to strictly put the setting in your copy of the configuration, but should review it nonetheless to make sure it matches your deployment expectations.

  • cas.authn.mfa.gauth.core.scratch-codes.encryption.key=
  • The encryption key. The encryption key by default and unless specified otherwise must be randomly-generated string whose length is defined by the encryption key size setting.

    org.apereo.cas.configuration.model.core.util.EncryptionRandomizedCryptoProperties.

  • cas.authn.mfa.gauth.core.issuer=CASIssuer
  • Issuer used in the barcode when dealing with device registration events. Used in the registration URL to identify CAS.

    org.apereo.cas.configuration.model.support.mfa.gauth.CoreGoogleAuthenticatorMultifactorProperties.

  • cas.authn.mfa.gauth.core.label=CASLabel
  • Label used in the barcode when dealing with device registration events. Used in the registration URL to identify CAS.

    org.apereo.cas.configuration.model.support.mfa.gauth.CoreGoogleAuthenticatorMultifactorProperties.

    The configuration settings listed below are tagged as Optional in the CAS configuration metadata. This flag indicates that the presence of the setting is not immediately necessary in the end-user CAS configuration, because a default value is assigned or the activation of the feature is not conditionally controlled by the setting value. In other words, you should only include this field in your configuration if you need to modify the default value or if you need to turn on the feature controlled by the setting.

  • cas.authn.mfa.gauth.core.scratch-codes.encryption.key-size=16
  • Encryption key size.

    org.apereo.cas.configuration.model.core.util.EncryptionRandomizedCryptoProperties.

  • cas.authn.mfa.gauth.core.code-digits=6
  • Length of the generated code.

    org.apereo.cas.configuration.model.support.mfa.gauth.CoreGoogleAuthenticatorMultifactorProperties.

  • cas.authn.mfa.gauth.core.multiple-device-registration-enabled=false
  • When enabled, allows the user/system to accept multiple accounts and device registrations per user, allowing one to switch between or register new devices/accounts automatically.

    org.apereo.cas.configuration.model.support.mfa.gauth.CoreGoogleAuthenticatorMultifactorProperties.

  • cas.authn.mfa.gauth.core.time-step-size=30
  • The expiration time of the generated code in seconds.

    org.apereo.cas.configuration.model.support.mfa.gauth.CoreGoogleAuthenticatorMultifactorProperties.

  • cas.authn.mfa.gauth.core.trusted-device-enabled=false
  • Indicates whether this provider should support trusted devices.

    org.apereo.cas.configuration.model.support.mfa.gauth.CoreGoogleAuthenticatorMultifactorProperties.

  • cas.authn.mfa.gauth.core.window-size=3
  • Since TOTP passwords are time-based, it is essential that the clock of both the server and the client are synchronised within the tolerance defined here as the window size.

    org.apereo.cas.configuration.model.support.mfa.gauth.CoreGoogleAuthenticatorMultifactorProperties.