Class HOTPService
- java.lang.Object
-
- com.sun.identity.authentication.modules.hotp.HOTPService
-
public class HOTPService extends Object
Provides the functionality to send OTP codes to a users Telephone and email.
-
-
Constructor Summary
Constructors Constructor Description HOTPService(AMIdentityRepository amIdentityRepo, String userName, HOTPParams hotpParams)Constructs an instance of the HOTPService.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisValidHOTP(String enteredHOTPCode)Determines if the given OTP code matches the OTP code that was sent previously.voidsendHOTP()Sends a otp code to the users telephone number and/or email address, based on the authentication module's configuration settings.
-
-
-
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 AuthLoginExceptionSends 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.
-
-