Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 655
Prashant Avatar asked Mar 07 '23 14:03

Prashant


2 Answers

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.

like image 51
KCP Avatar answered Apr 07 '23 02:04

KCP


A dynamic URL Redirect is not supported by the current behavior.

This is due to a change to the handling of redirect URIs, announced in December 2017, and taking effect this month, Enabling strict mode is required in order to use OAuth redirects:

https://developers.facebook.com/blog/post/2017/12/18/strict-uri-matching/

Make sure to set App Domain in:

https://developers.facebook.com/apps/[your-app-ip]/settings/basic/

Also all you callback urls including the https:// Please see:

https://developers.facebook.com/apps/[your-app-ip]/fb-login/settings/

  • If you are using the PHP SDK, please ensure you have the latest version installed (v5.6.2).
like image 23
JorgeO Avatar answered Apr 07 '23 01:04

JorgeO