High level API (using Play forms).
High level API (using Play forms).
Binds form data from the request, and if valid then verifies the recaptcha response, by invoking the Google Recaptcha verify web service (API v1 or v2) in a reactive manner. Possible errors include:
Apart from generic binding error, the recaptcha errors are populated against the artificial
form field key formErrorKey
, handled by the recaptcha view template tags.
The form
Implicit - The current web request
Implicit - The execution context used for futures
A future that will be the form to use, either populated with an error or success
IllegalStateException
Developer errors that shouldn't happen - Plugin not
present or not enabled, no recaptcha challenge, or muliple challenges or responses found
Low level API (independent of Play form and request APIs).
Low level API (independent of Play form and request APIs).
Verifies whether a recaptcha response is valid, by invoking the Google Recaptcha API version 1 verify web service in a reactive manner.
The recaptcha challenge
The recaptcha response, to verify
The IP address of the end user
Implicit - The execution context used for futures
A future that will be either an Error (with a code) or Success
IllegalStateException
Developer errors that shouldn't happen - Plugin not present
or not enabled
Low level API (independent of Play form and request APIs).
Low level API (independent of Play form and request APIs).
Verifies whether a recaptcha response is valid, by invoking the Google Recaptcha API version 2 verify web service in a reactive manner.
The recaptcha response, to verify
The IP address of the end user
Implicit - The execution context used for futures
A future that will be either an Error (with a code) or Success
IllegalStateException
Developer errors that shouldn't happen - Plugin not present
or not enabled
Verifies whether a recaptcha response is valid, by invoking the Google Recaptcha verify web service.
Follows the API documented at Verify Without Plugins.
The package private constructor allows injection of dependencies (e.g. for unit testing), the no-arguments public constructor is for production use.