Package org.dspace.eperson.service
Interface CaptchaService
- All Known Implementing Classes:
AltchaCaptchaServiceImpl,CaptchaServiceImpl
public interface CaptchaService
This service for validate the reCaptcha token
- Author:
- Mohamed Eskander (mohamed.eskander at 4science dot it)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbytesToHex(byte[] bytes) Encode bytes to hex stringstatic StringcalculateHash(String input, String algorithm) Calculate a hex string from a digest, given an input stringvoidprocessResponse(String response, String action) validate the entered reCaptcha token
-
Field Details
-
REGISTER_ACTION
- See Also:
-
-
Method Details
-
processResponse
validate the entered reCaptcha token- Parameters:
response- reCaptcha token to be validatedaction- action of reCaptcha- Throws:
InvalidReCaptchaException- if reCaptcha was not successfully validated
-
bytesToHex
Encode bytes to hex string- Parameters:
bytes- bytes to encode- Returns:
- hex string
-
calculateHash
Calculate a hex string from a digest, given an input string- Parameters:
input- input stringalgorithm- algorithm key, eg. SHA-256- Returns:
- Throws:
NoSuchAlgorithmException
-