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.This implementation allows anyone who logs in through Facebook to join your Experience Cloud site.
If you want your Experience Cloud site to be accessible only to existing members, implement a filter to recognize every valid user. Base your filter on any unique data in the Facebook packet, such as username or email address, and then validate that data against similar fields in your Experience Cloud site members’ records.
-
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.