Class HOTPService


  • public class HOTPService
    extends Object
    Provides the functionality to send OTP codes to a users Telephone and email.
    • Constructor Detail

      • HOTPService

        public HOTPService​(AMIdentityRepository amIdentityRepo,
                           String userName,
                           HOTPParams hotpParams)
        Constructs an instance of the HOTPService.
        Parameters:
        amIdentityRepo - An instance of the AMIdentityRepository.
        userName - The user's name.
        hotpParams - The authentication modules configuration settings.
    • Method Detail

      • sendHOTP

        public void sendHOTP()
                      throws AuthLoginException
        Sends a otp code to the users telephone number and/or email address, based on the authentication module's configuration settings.
        Throws:
        AuthLoginException - If there is a problem sending the OTP code.
      • isValidHOTP

        public boolean isValidHOTP​(String enteredHOTPCode)
        Determines if the given OTP code matches the OTP code that was sent previously.
        Parameters:
        enteredHOTPCode - The OTP code to verify.
        Returns:
        Whether the OTP code matches the OTP code that was sent to the user.