Interface CaptchaValidationStrategy
- All Known Implementing Classes:
GoogleRecaptchaV2ValidationStrategy
public interface CaptchaValidationStrategy
Strategy to validate the captcha response provided
-
Method Summary
Modifier and TypeMethodDescriptionget the captcha providerget the captcha versionbooleanpreCheckToken(CaptchaValidationContext captchaValidationContext) pre-check the token before really call providervalidate(CaptchaValidationContext captchaValidationContext) validate the given captcha-token and return the validate result.
-
Method Details
-
validate
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
CaptchaVersionWsDtoType getVersion()get the captcha version- Returns:
- CaptchaVersionWsDtoType: for now , just GOOGLE's V2
-
preCheckToken
pre-check the token before really call provider- Parameters:
captchaValidationContext-- Returns:
-