VerificationResult

public abstract classVerificationResultextendsObject

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 stateverificationHandle()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 stateverificationHandle()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 staterecaptchaToken()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.
abstractRecaptchaOptionalObject<String>
recaptchaToken()
Returns an optional containing the reCAPTCHA token if the verification operation was successful or aborted.
abstractRecaptchaOptionalObject<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

publicVerificationResult()

Public Methods

public abstract Status getVerificationStatus()

Returns a status to provide more info on the result of the verification operation.

Returns
  • CommonStatusCodes.SUCCESSor RecaptchaStatusCodes.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 abstractRecaptchaOptionalObject<String> recaptchaToken()

Returns an optional containing the reCAPTCHA token if the verification operation was successful or aborted.

Returns
  • the reCAPTCHA token ifgetVerificationStatus().equals( CommonStatusCodes.SUCCESS)orgetVerificationStatus().equals( RecaptchaStatusCodes.RECAPTCHA_2FA_ABORTED),otherwise an emptyRecaptchaOptionalObject.

public abstractRecaptchaOptionalObject<VerificationHandle> verificationHandle()

Returns an optional containing a verification handle if the verification operation failed and the client is allowed to retry.

Returns