Define a Salesforce Auth. Provider
To enable external authentication in Salesforce, create an Auth. Provider.
External authentication through Facebook requires the App ID and App Secret from the Facebook app that you created in the previous step.
-
In Setup, enter
Auth. Providers
in the Quick Find box, then select Auth. Providers. -
Click New.
-
Configure the Auth. Provider fields as shown in the following table.
Field Value Provider Type Select Facebook. Name Enter FB Community Login. URL Suffix Accept the default.
Note: You may also provide any other string that conforms to URL syntax, but for this example the default works best.Consumer Key Enter the App ID from your Facebook app. Consumer Secret Enter the App Secret from your Facebook app. Custom Error URL Leave blank. -
For Registration Handler, click Automatically create a registration handler template.
-
For Execute Registration As:, click Search and choose an Experience Cloud site member who has administrative privileges.
-
Leave Portal blank.
-
Click Save.
Salesforce creates a new Apex class that extends
RegistrationHandler
. The class name takes the form AutocreatedRegHandlerxxxxxx…. -
Copy the Auth. Provider ID for later use.
-
In the detail page for your new Auth. Provider, under Client Configuration, copy the Callback URL for later use.
The callback URL takes the form
https://login.salesforce.com/services/authcallback/<*id*>/<*Auth.Provider_URL_Suffix>.