You can implement a custom multi-factor authentication (MFA) service in Apex by using the System.UserManagement class methods. The verification step is completed with the UserManagement.verifyVerificationMethod() method, which creates a VerificationHistory record that is visible in Setup under Identity Verification History.
The VerificationHistory record is committed to the database at the end of a transaction by a transaction observer that is registered when UserManagement.verifyVerificationMethod runs. Calling Database.rollback in the same transaction removes this transaction observer, so the record is not committed to the database, regardless of where in the transaction the savepoint was created.
This article explains why Salesforce Identity Verification History records are not saved when Apex calls Database.rollback in the same transaction as UserManagement.verifyVerificationMethod, and how to avoid the problem.
Avoid calling Database.rollback in any transaction where you need the Verification History record to be committed to the database.
005390889

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.