Class MfaValidationServiceImpl
java.lang.Object
nl._42.restsecure.autoconfigure.authentication.mfa.MfaValidationServiceImpl
- All Implemented Interfaces:
MfaValidationService
Service which contains logic to validate MFA tokens.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
verifyMfaCode
(String secret, String code) Validates if the given MFA code is valid right now.
-
Constructor Details
-
MfaValidationServiceImpl
public MfaValidationServiceImpl(dev.samstevens.totp.code.CodeVerifier verifier)
-
-
Method Details
-
verifyMfaCode
Validates if the given MFA code is valid right now.- Specified by:
verifyMfaCode
in interfaceMfaValidationService
- Parameters:
secret
- Secret key of the user (e.g. from a database or credentials store)code
- Given MFA code (usually a 6-digit key)- Returns:
- True if the given MFA code is valid. False if not.
-