Instructions
Add-on Details
The Facebook OAuth add-on will enable your users to login with Facebook. You'll need to create a Facebook App to use this add-on.
Note: The PHP cURL extension is required for this add-on to work.
How To Add
Add the "facebook-oauth.php" file to your project directory.
Edit the "config.php" file and add the following constants:
/* Facebook OAuth */
// The OAuth App ID associated with your Facebook App.
define('facebook_oauth_app_id','YOUR_APP_ID');
// The OAuth App secret associated with your Facebook App.
define('facebook_oauth_app_secret','YOUR_APP_SECRET_ID');
// The URL to the Facebook OAuth file.
define('facebook_oauth_redirect_uri','http://localhost/phplogin/facebook-oauth.php');
Edit the "index.php" file and find this line:
<button class="btn blue" type="submit">Login</button>
Add below:
<a href="facebook-oauth.php" class="fb-btn">
<svg width="14" height="14" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M512 256C512 114.6 397.4 0 256 0S0 114.6 0 256C0 376 82.7 476.8 194.2 504.5V334.2H141.4V256h52.8V222.3c0-87.1 39.4-127.5 125-127.5c16.2 0 44.2 3.2 55.7 6.4V172c-6-.6-16.5-1-29.6-1c-42 0-58.2 15.9-58.2 57.2V256h83.6l-14.4 78.2H287V510.1C413.8 494.8 512 386.9 512 256h0z"/></svg>
Login with Facebook
</a>
That's all you need to do. Make sure to update the new constants in the config file. If it doesn't work, make sure you have the PHP cURL extension enabled.