Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Customize the Auth. Provider Apex Class
Use the Apex class for your Auth. Provider to define filtering logic that controls who
may enter your Experience Cloud site.
- In Setup, enter Apex Classes in the Quick Find box, then select Apex Classes.
- Click Edit next to your Auth. Provider class. The default class name starts with “AutocreatedRegHandlerxxxxxx…”
-
To implement the canCreateUser() method, simply return true.
1global boolean canCreateUser(Auth.UserData data) { 2 return true; 3}This implementation allows anyone who logs in through Facebook to join your Experience Cloud site. -
Change the createUser() code:
- Replace “Acme” with FineApps in the account name query.
- Replace the username suffix (“@acmecorp.com”) with @fineapps.com.
- Change the profile name in the profile query (“Customer Portal User”) to API Enabled.
- In the updateUser() code, replace the suffix to the username (“myorg.com”) with @fineapps.com.
- Click Save.