Class GoogleTwoFactorAuthenticationService

    • Constructor Detail

      • GoogleTwoFactorAuthenticationService

        public GoogleTwoFactorAuthenticationService()
    • Method Detail

      • isValid

        public boolean isValid​(Object securityToken,
                               UserAccount userAccount,
                               HttpServletRequest request)
        Checks additional authentication factors (not including the password) for a user.
        Specified by:
        isValid in interface ITwoFactorAuthenticationService
        Parameters:
        securityToken - the one-time password produced by Google Authenticator, provided as a String
        userAccount - the user account
        request - the HTTP servlet request
        Returns:
        true if the additional authentication factors were verified successfully, false otherwise
      • sendResetEmail

        public void sendResetEmail​(UserAccount userAccount,
                                   Portal portal)
        Send an email with instructions on how to apply a new key to the given user.
        Specified by:
        sendResetEmail in interface ITwoFactorAuthenticationService
        Parameters:
        userAccount - the user (required)
        portal - the portal (required)
      • getEndOfGracePeriod

        public Date getEndOfGracePeriod()
        Return the date after which users can no longer log on without providing a correct token. If not set, no grace period is being used.
        Specified by:
        getEndOfGracePeriod in interface ITwoFactorAuthenticationService
        Returns:
        the end of the grace period
      • setEndOfGracePeriod

        public void setEndOfGracePeriod​(Date endOfGracePeriod)
        Set the date after which users can no longer log on without providing a correct token. If set to null or a date in the past, no grace period is being used.
        Parameters:
        endOfGracePeriod - the end 0f the grace period
      • isInGracePeriod

        public boolean isInGracePeriod()
        Return whether users can currently log on without providing a token prior to having enrolled.
        Specified by:
        isInGracePeriod in interface ITwoFactorAuthenticationService
        Returns:
        whether a grace period is currently active
      • getIssuer

        public String getIssuer()
        Return the issuer string identifying the organization that users are setting up Google Authenticator accounts with.
        Returns:
        the issuer string
      • setIssuer

        public void setIssuer​(String issuer)
        Set the issuer string identifying the organization that users are setting up Google Authenticator accounts with.
        Parameters:
        issuer - the new issuer string
      • getServiceDefinition

        public ServiceDefinition getServiceDefinition()
        Return the service definition for the service.
        Specified by:
        getServiceDefinition in interface IServiceDefinitionAware
        Returns:
        the service definition for the service.
        See Also:
        IServiceDefinitionAware#gsetServiceDefinition()