I was trying to login with facebook using php for a web application that I am working on, I managed to make it work on my localhost so I proceeded to use the IIS and got a domain for the application but when trying to login it gives me the following error:
ERROR: Unable to load the URL: The domain of this URL is not included in the domains of the application. In order to load this URL, add all the domains and subdomains of your application in the "Application domains" field in the application settings.
The domain I'm using is socialsocial.itsales.online and I made sure that it was in the field designated for this in the facebook application panel
This is the code of my login:
<?php
if(!session_id()) {
session_start();
}
// Include the required dependencies.
require_once( 'vendor/autoload.php' );
$fb = new Facebook\Facebook([
'app_id' => 'app_id',
'app_secret' => 'app_secret',
'default_graph_version' => 'v3.1',
]);
$helper = $fb->getRedirectLoginHelper();
$loginUrl = $helper->getLoginUrl(
'https://redessociales.itsales.online:444/fb/fb-callback.php',
array('scope' => 'pages_show_list, manage_pages, publish_pages, user_photos'
));
echo '<a href="' . htmlspecialchars($loginUrl) . '">Log in with Facebook! </a>';
echo '<br>'
?>
If someone has an idea that it could be my problem or that I am doing wrong, I would appreciate it if you did it to me.
Thank you!