February 9, 2021

Async Apex Jobs to generate PDF with Visualforce page when Salesforce MFA is enabled

You may see the PDF content with /_ui/identity/verification/policy/VerificationStartUi/e? in the JavaScript or Blank PDF. The issue is due to "Session Security Level Required at Login" set to "High Assurance".
 
Option 1:
Use Batch Apex to generate the PDF and attach it to the record. The batch class should run as a user who doesn't have "Session Security Level Required at Login".

Option 2:
1. Publish a Platform Event.
2. From Platform Event trigger, call Future or Queueable Interface class to generate the PDF and attach it to the record.

Option 3:
1. Set "Session Security Level Required at Login" as None.
2. Enable "Multi-Factor Authentication for User Interface Logins".
 

No comments:

Post a Comment