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.