Error loading facebook PHP SDK URL when logging in

Asked

Viewed 1,325 times

1

My login function is thus on Laravel

public function loginFacebook(){
    $fb = new Facebook([
        'app_id' => 'xxxxxxxxxxxxxxx',
        'app_secret' => 'xxxxxxxxxxxxxxxxxxxxxxxx',
        'default_graph_version' => 'v2.10',
        ]);

    $helper = $fb->getRedirectLoginHelper();

    $permissions = ["pages_show_list", "manage_pages", "pages_messaging", "pages_messaging_phone_number", "pages_messaging_subscriptions", "public_profile", "email"]; // Optional permissions
    $loginUrl = $helper->getLoginUrl('https://teste.dev.br/login/facebook/callback', $permissions);

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

And in the app settings is with the domain configured as images below:

Dominio do app

And the website URL.

URL do site

But when I spin, it triggers the following error in the Facebook

Unable to load the URL: The domain of that URL is not included in the application domains. To upload this URL, add all domains and subdomains to the Application Domains field in the app settings.

What may be happening?

  • Putz I suffered with this ai huh, the error is generic, it may be several things, but by your prints, it seems that it lacks the url of callback, where it will return after login.

  • In addition to setting up this basic information, you need to set up oauth, the left panel has products, click there and follow the steps to activate oauth... Inside the settings it will have the option to add the callbacks

  • @edsonalves, where is located this oauth option? I’m not finding

  • Vc have to add a product. In the left corner has a +(more) in products. In the product options will have oauth

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.