VerificationResult Class

Contains the result of a verification challenge that you invoke when you create your own Verify page. The challenge can be initiated by either the System.UserManagement.verifyPasswordlessLogin or System.UserManagement.verifySelfRegistration method.

Auth

When users sign up for or log in to your Experience Cloud site with an email address or phone number, Salesforce sends them a verification code. At the same time, Salesforce generates the Verify page for users to enter the code to verify their identity. You can replace the Salesforce-generated Verify page with one that you create with Visualforce. Then invoke the verification challenge and, if the verification code is entered correctly, log in the user. For sign-up, you use the System.UserManagement.verifySelfRegistration method. For passwordless login, you use the System.UserManagement.verifyPasswordlessLogin method. The methods return the verification result, which contains the message displayed as a result of the challenge. This message also indicates whether the challenge is successful and where to direct the user when the verification code is entered correctly.

This code contains the result of a verification challenge that registers a new user.

VerificationResult has the following constructor.

Creates an instance of the VerificationResult class that contains the verification result from System.UserManagement.verifySelfRegistration.

public VerificationResult(System.PageReference redirect, Boolean success, String message)

  • redirect:

    Type: System.PageReferenceSystem.PageReference Where user is directed upon successful verification.

  • success:

    Type: Boolean

    Indicates whether verification succeeded.

  • message:

    Type: String

    Message that displays as a result of a verification challenge.

The following are properties for VerificationResult.

  • message

    Message that displays as a result of a verification challenge. Token is valid if the identity verification is successful. Other values are FAILURE, PENDING, RATE_LIMITED, or FAILURE_REPORT.

  • redirect

    Where the user is directed after entering the verification code successfully, for example, the Experience Cloud site’s home page or location specified by the start URL.

  • success

    The verification challenge is successful.

Message that displays as a result of a verification challenge. Token is valid if the identity verification is successful. Other values are FAILURE, PENDING, RATE_LIMITED, or FAILURE_REPORT.

public String message {get; set;}

Type: String

Where the user is directed after entering the verification code successfully, for example, the Experience Cloud site’s home page or location specified by the start URL.

public System.PageReference redirect {get; set;}

Type: System.PageReferenceSystem.PageReference

The verification challenge is successful.

public Boolean success {get; set;}

Type: Boolean

VerificationResult has the following method.

  • clone()

    Duplicates the Auth.VerificationResult object.

Duplicates the Auth.VerificationResult object.

public Object clone()

Type: VerificationResult