Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

URL Blocked: This redirect failed because the redirect URI is not whitelisted....(Localhost web application)

URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs.

I've installed the laravel/socialite and I'm trying to link my application with facebook ! after installing the package ,creating my facebook application , I try to acces to the login page with facebook on my application but it keeps telling me that ther's some kind of URL errors ... ??? any ideas.?

like image 454
řĕĕ ňă Avatar asked Feb 19 '16 16:02

řĕĕ ňă


People also ask

How do I fix my blocked URL?

The error message tells what the issue is: "URL blocked: This redirect failed because the redirect URI is not whitelisted in the app's client OAuth settings. Make sure that the client and web OAuth logins are on and add all your app domains as valid OAuth redirect URIs." This is easily fixed.

How do I redirect a URL on Facebook app?

In your app settings on https://developers.facebook.com/sa/apps/<my-app-id> , make sure that you add the Facebook Login product. Then under "Client OAuth Settings" enter the URL in the "Valid OAuth redirect URIs" box.


4 Answers

I faced this issue as well.
What I did: When you get this message, copy the URL from the browser window, and inspect it. The URL has the redirect URL mentioned within it.
Copy the exact redirect URL as mentioned, and put it under Valid OAuth Redirect URLs, it will solve the problem.

like image 72
Jyotirmoy Avatar answered Oct 18 '22 20:10

Jyotirmoy


It's redirect URL problem. Facebook automatically generates a redirect URL which is http://...[your domain]..../signin-facebook. You need to add this URL to Client OAuth Settings along with your own redirect_URL like below: enter image description here

Hope it helps

like image 28
Hung Vu Avatar answered Oct 18 '22 20:10

Hung Vu


I've just had the issue (Nov 2017), after years of it working (but did I change something inadvertently?).

The fix was to add the callback url in the "Facebook Login" "Products" (in the left menu, in the Facebook admin console, NOT in the "Advanced settings" where I've tried everything:

https://developers.facebook.com/apps/{{your FB app id}}/fb-login/settings/

Note that you need to put the port number if you have one, e.g. in my case http://local.dishly.menu:3000/

like image 38
Nico Avatar answered Oct 18 '22 21:10

Nico


I had an issue with this, specifically with heroku. My test site was not https. It was http. And by default, facebook likes to prepend a url with https if you don't manually type it in when typing in the url.

So, I added two urls. one with http, and one with https. works fine now \o/

like image 3
Salx Avatar answered Oct 18 '22 21:10

Salx