Newer Version Available

This content describes an older version of this product. View Latest

VerificationResult Class

Stores the result of the System.UserManagement.verifySelfRegistration method. The method returns the result of a verification challenge that you invoke when you create your own Verify page. It contains the verification status and session ID if the user is created successfully.

Namespace

Auth

Usage

When users sign up for your community with an email address or phone number, Salesforce sends them a verification code and generates the Verify page for users to confirm their identity. To replace the Salesforce Verify page with your own, use the initSelfRegistration and verifySelfRegistration methods. initSelfRegistration initiates a verification challenge and includes a user object to be inserted after successful registration. verifySelfRegistration completes the verification, and if successful, the user is created and logged in. The method returns the verification result, which contains the verification status and session ID if the user is created.

Example

VerificationResult Constructor

VerificationResult has the following constructor.

VerificationResult(redirect, success, message)

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

Signature

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

Parameters

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.

VerificationResult Properties

The following are properties for VerificationResult.

message

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

Signature

public String message {get; set;}

Property Value

Type: String

redirect

Where the user is directed if they successfully enter the verification code.

Signature

public System.PageReference redirect {get; set;}

Property Value

Type: System.PageReferenceSystem.PageReference

success

The verification challenge is successful.

Signature

public Boolean success {get; set;}

Property Value

Type: Boolean

VerificationResult Method

VerificationResult has the following method.

clone()

Duplicates the Auth.VerificationResult object.

Signature

public Object clone()

Return Value

Type: VerificationResult