Follow the below steps to connect to the Facebook API.
- Go to the Meta for Developers page.
- Click the Create App button.
- Select Other and Consumer as the app type, and fill in the rest of the details.
- Once created, in the left-hand sidebar, click the Add Product button and select Facebook Login.
- Select Web as the type and your website address into Site URL.
- Navigate to Facebook Login section in the left-hand sidebar, click Settings.
- For the Valid OAuth Redirect URIs setting, enter the value from the Redirect URI field in Social Login.
- Click the Save Changes button.
- Navigate to App Review → Requests.
- Switch the App Mode toggle to Live.
- Click Request Permissions or Features.
- Locate the public_profile permission and click the Get advanced access button.
- Locate the email permission and click the Get advanced access button.
- Navigate to App Settings → Basic item in the left-hand sidebar.
- Enter your domain name to the App Domains field.
- Fill in the Privacy Policy and User Data Deletion fields as applicable.
- Click the Save Changes button.
- Copy the App ID from Facebook and paste in the Client ID field in Social Login.
- Copy the App Secret from Facebook and paste in the Client Secret field in Social Login.
Ensure that you pick Facebook Login and not Facebook Login for Business, which are different products. If you must use Facebook Login for Business, you'll need to provide additional scopes, as per the below.
If you require the use of the Facebook Login for Business product in your Facebook App, you may do so, but note that you'll need to supply additional scopes in your configuration.
<?php
return [
'*' => [
// ...
'providers' => [
'facebook' => [
// ...
'scopes' => [
'business_management',
],
],
],
]
];