Interface CaptchaValidationStrategy

All Known Implementing Classes:
GoogleRecaptchaV2ValidationStrategy

public interface CaptchaValidationStrategy
Strategy to validate the captcha response provided
  • Method Details

    • validate

      CaptchaValidationResult validate(CaptchaValidationContext captchaValidationContext)
      validate the given captcha-token and return the validate result.
      Parameters:
      captchaValidationContext - a context which contains the token need to be validated.
      Returns:
      CaptchaValidationResult : a dto has two fields "success" and "reason", the token is valid when success is true, otherwise , the token is invalid and reason is the error detail.
      Throws:
      IllegalArgumentException - when captchaValidationContext is null
    • getProviderType

      CaptchaProviderWsDtoType getProviderType()
      get the captcha provider
      Returns:
      CaptchaProviderWsDtoType: for now , just GOOGLE
    • getVersion

      get the captcha version
      Returns:
      CaptchaVersionWsDtoType: for now , just GOOGLE's V2
    • preCheckToken

      boolean preCheckToken(CaptchaValidationContext captchaValidationContext)
      pre-check the token before really call provider
      Parameters:
      captchaValidationContext -
      Returns: