To use your custom one-time password (OTP) delivery handler Apex class, add it to your Experience Cloud site settings.
Required Editions
| Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience |
| Available in: Professional, Enterprise, Unlimited, and Developer Editions |
| User Permissions Needed | |
|---|---|
| To customize an Experience Cloud site: |
|
| To publish an Experience Cloud site: |
|
Before you get started, create an Apex class that implements the Auth.CustomOneTimePasswordDeliveryHandler
interface.
To add a custom OTP delivery handler to an Experience Cloud site, you must contact Salesforce Customer Support. When Support gives you access to this feature, we recommend that you configure all Experience Cloud sites in your org to use a custom OTP provider. If you don't configure a custom OTP provider, though, the site uses the Salesforce default provider.
- Contact Salesforce Customer Support and ask to allow a custom messaging service for OTPs sent to external users.
- From Setup, in the Quick Find box, enter Sites, and then select All Sites.
- Next to your Experience Cloud site name, click Workspaces.
- Select Administration, and then select Login & Registration.
- Under Custom One-Time Password (OTP) Delivery, for OTP Delivery Handler, click
and search for the custom OTP delivery Apex class that
you created. - Save your changes.
- Test all configurations for your site that send an OTP via SMS. When you confirm that all use cases are working as expected, implement your changes in production.