As like LinkedIn, your users can also Signup or Log in using their Facebook account. To enable this feature, you need to activate the Facebook API key.
Let’s see, how to create Facebook API key.
Create a Facebook App #
- Go to Meta for Developers and log in.
- Go to My App section. Click “Create App”.
- Provide App name and contact email.
- In the Use Case tab, select the “Authenticate and request data from users with Facebook Login” and then click “Next.”
- Choose the business profile you want to connect to the app.
- After selecting the business, click on “Next.” You will see a requirement page. Just click on “Next” there too.
- Click “Go to Dashboard”.
- Click the “Use cases” tab on the left side, and then click the “Customize” button next to the “Authentication and account creation” item.
- Under Permissions, click Add next to Email
- Add the following URL to the “Valid OAuth redirect URIs” field (sitename.com will be your website domain): https://sitename.com/wp-login.php?wp_social_login=facebook Click the “Save changes” button
Note: If you receive a blank page after you press the “Save changes” button, try to refresh the page
Configuring the App #
- On the left side, click the “App settings” tab, then click “Basic“
- Enter your domain name in the “App Domains” field.
- Fill in the “Privacy Policy URL” field. Provide a publicly available and easily accessible Privacy Policy that explains what data you are collecting and how you will use that data.
- At the “User Data Deletion“, choose the “Data Deletion Instructions URL” option, and enter the URL of your page* with the instructions on how users can delete their accounts on your site.
- Select a “Category” for your App.
- Upload an App icon. It should be 1024×1024.
- Click the “+ Add platform” button at the bottom of the page
- Select “Website” as the platform, then press “Next“
- Enter your site URL
- Click “Save changes“.
By default, your application only has Standard Access for the “public_profile” and “email” permissions, which means that only you can log in with it.
To get Advanced Access you will need to go through the Business Verification, and you can start on the “Verification” tab on the left side.
App Verification #
- On the left menu, navigate to Review > App Review
- Click Edit on your current request
- Answer Data handling questions then click Submit
- Complete the app verification process
- Provide Verification details
- How will your app use the Advanced Access Email permission
- How will your app use the Advanced Access public_profile permission
- Click Submit for Review.
App Publishing #
- Once all are done, click on the “App settings” tab, then click “Basic“
- At the top of the page, you can find your “App ID” and you can see your “App secret” if you click on the Show button.
- Paste these keys back to your site to complete the setup for Facebook Social Login.