AI-generated Key Takeaways
-
VerificationResult is an immutable object that holds the result of a verification operation and can be in three states: Succeeded, Aborted, or Failed.
-
A Succeeded state means the verification was successful and provides a recaptchaToken to verify the account with the reCAPTCHA Enterprise server.
-
An Aborted state indicates the reCAPTCHA server aborted the operation, providing a recaptchaToken for more information from the reCAPTCHA Enterprise server.
-
A Failed state means the verification failed but provides a verificationHandle to allow for additional retries.
-
The status of the verification can be obtained using the getVerificationStatus() method.
Immmutable object to hold the result of a verification operation. This object can be in three possible states:
| Status | Condition | Expected results |
|---|---|---|
|
Succeeded
|
getVerificationStatus().equals(CommonStatusCodes.SUCCESS)
|
In this state verificationHandle()
will be absent but recaptchaToken()
will not. The token can be used with the reCAPTCHA
Enterprise server to verify that the account is indeed verified. |
|
Aborted
|
getVerificationStatus().equals(RecaptchaStatusCodes.RECAPTCHA_2FA_ABORTED)
|
In this state verificationHandle()
will be absent but recaptchaToken()
will not. In this case reCAPTCHA server has aborted the
operation, and more information on the reasons of the abortion can be obtained by calling
the reCAPTCHA Enterprise server with the token. |
|
Failed
|
!getVerificationStatus().equals(CommonStatusCodes.SUCCESS) &&
!getVerificationStatus().equals(RecaptchaStatusCodes.RECAPTCHA_2FA_ABORTED)
|
In this state recaptchaToken()
will be absent but verificationHandle()
will not, to allow for additional retries. |
Public Constructor Summary
Public Method Summary
| abstract Status | getVerificationStatus
()
Returns a status to provide more info on the result of the verification
operation.
|
| abstract RecaptchaOptionalObject < String > | recaptchaToken
()
Returns an optional containing the reCAPTCHA token if the verification
operation was successful or aborted.
|
| abstract RecaptchaOptionalObject < VerificationHandle > | verificationHandle
()
Returns an optional containing a verification handle if the verification
operation failed and the client is allowed to retry.
|
Inherited Method Summary
Public Constructors
public VerificationResult ()
Public Methods
public abstract Status getVerificationStatus ()
Returns a status to provide more info on the result of the verification operation.
Returns
-
CommonStatusCodes.SUCCESSorRecaptchaStatusCodes.RECAPTCHA_2FA_ABORTEDstatus if the verification operation succeeded, and non-success status (e.g.RecaptchaStatusCodes.RECAPTCHA_2FA_PIN_MISMATCH) if the verification failed with more attempts available, i.e. user entered wrong pin.
public abstract RecaptchaOptionalObject < String > recaptchaToken ()
Returns an optional containing the reCAPTCHA token if the verification operation was successful or aborted.
Returns
- the reCAPTCHA token if
getVerificationStatus().equals( CommonStatusCodes.SUCCESS)orgetVerificationStatus().equals( RecaptchaStatusCodes.RECAPTCHA_2FA_ABORTED), otherwise an emptyRecaptchaOptionalObject.
public abstract RecaptchaOptionalObject < VerificationHandle > verificationHandle ()
Returns an optional containing a verification handle if the verification operation failed and the client is allowed to retry.
Returns
- a verification handle on a failure status, otherwise an empty
RecaptchaOptionalObject.

