Search code examples
phpfacebookapilaravel-5facebook-php-sdk

Facebook Auth: Can't Load URL: The domain of this URL isn't included in the app's domains


I know that this question has been asked previously in this link Facebook OAuth "The domain of this URL isn't included in the app's domain" , but the solution is not working for me.

It’s showing the error like this: enter image description here

I have included my domain in the app’s domain of facebook api as well, The redirect url format that I am passing goes like this: https://example.com/clients/authorization/facebook/a1njk2nkll55343nlk4/page

Here the random characters after facebook/ is the id of the client which is dynamic.

Moreover, I am having the same problem while logging through facebook as well.

Thank You.


Solution

  • This might be the problem due to the security update of Facebook API.

    This is from Facebook developer dashboard!

    "In March, we're making a security update to your app settings that will invalidate calls from URIs not listed in the Valid OAuth redirect URIs field"

    So, for that Add your site's callback url in the Valid OAuth redirect URIs field

    You need to add your oAuth Redirect URI properly in the Facebook Login->Settings: Valid OAuth Redirect URIs In Valid OAuth Redirect URIs, You can include the uri in this format: https://example.com/clients/authorization/facebook

    And the redirect uri while authenticating can be as follow: https://example.com/clients/authorization/facebook&a1njk2nkll55343nlk4/page

    Here "&" separates your required other parameters.

    The same case applies for facebook Login. Add your full login redirect uri to the Valid OAuth Redirect URIs. Like this:

    https://example.com/login/facebook/callback

    Hope This helps.

    Thanks.