S
S
scottparker2020-05-15 05:53:50
PHP
scottparker, 2020-05-15 05:53:50

What's wrong with facebook api authorization?

Hello. You need to post messages in the group. I'm trying to get an access_token I
created an application, a screenshot of the application settings
5ebe0279b55e1980069823.jpeg

and a code from off sources, for example from here

<?
// старт сессии необходим библиотеке
session_start();

require_once __DIR__ . '/vendor/autoload.php';

// App ID и App Secret из настроек приложения
$app_id = "872746109905037";
$app_secret = "0432525a87e6350cb5d7fa3cad750e98";

// ссылка на страницу возврата после авторизации
// домен должен совпадать с указанным в настройках приложения
$callback = "http://mod.bfdev.ru/login-callback.php";

$fb = new Facebook\Facebook([
  'app_id'  => $app_id,
  'app_secret' => $app_secret,
  'default_graph_version' => 'v2.10',
]);
  
$helper = $fb->getRedirectLoginHelper();
$permissions = ['email', 'user_likes']; // optional
$loginUrl = $helper->getLoginUrl($callback, $permissions);

echo '<a href="' . $loginUrl . '">Log in with Facebook!</a>';


gives the following error
5ebe03dfb20a5261720463.jpeg

can anyone tell me what is wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alternativshik, 2020-05-15
@alternativshik

did not complete everything.
You need to click on the plus sign in Products and add Login via FB there and configure everything there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question