Class MfaValidationServiceImpl

java.lang.Object
nl._42.restsecure.autoconfigure.authentication.mfa.MfaValidationServiceImpl
All Implemented Interfaces:
MfaValidationService

public class MfaValidationServiceImpl extends Object implements MfaValidationService
Service which contains logic to validate MFA tokens.
  • Constructor Details

    • MfaValidationServiceImpl

      public MfaValidationServiceImpl(dev.samstevens.totp.code.CodeVerifier verifier)
  • Method Details

    • verifyMfaCode

      public boolean verifyMfaCode(String secret, String code)
      Validates if the given MFA code is valid right now.
      Specified by:
      verifyMfaCode in interface MfaValidationService
      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.