I'm trying to allow users to login with facebook to my website but I am getting the following error:
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 configured my Facebook app like this:
1.Made it Public
2.Website
site URL: http://localhost:8000/ (since I'm running locally)
https://django-allauth.readthedocs.io/en/latest/faq.html#why-did-you-just-close-my-issue
The short summary is you need to whitelist http://localhost:8000/accounts/facebook/login/callback/ (replace http://localhost:8000 with the URL of your site, including https://, if you're running into this problem in production).
I was getting same error, as per your suggestion ,I changed http to https, then this problem is resolved, but After onclick of continue as facebook account, it displaying -->> This site can’t be reached.
i am getting this error to loggin into facebook from my laravel code.
URL blocked: This redirect failed because the redirect URI is not white-listed 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.
I configured my Facebook app like this:
1.Made it Public
2.Website
site URL: http://localhost:8000/ (since I'm running locally)
this is my services.php
'facebook' => [
'client_id' => '****',
'client_secret' => '************',
'redirect' => 'https://localhost:8000/callback',
'default_graph_version' => 'v4.0',
],
this is my controller
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Socialite;
class SocialAuthFacebookController extends Controller
{
public function redirect()
{
return Socialite::driver('facebook')->redirect();
}
public function callback()
{
return Socialite::driver('facebook')->redirect();
// return redirect()->to('http://localhost:8000/callback');
}
}
and this is web.php
Route::get('/', function () {
return view('welcome');
});
Auth::routes();
Route::get('/redirect', 'SocialAuthFacebookController@redirect');
Route::get('/callback', 'SocialAuthFacebookController@callback');
Route::get('/home', 'HomeController@index')->name('home');
plz help
@2015pgcaca44 this repo is for a django app not laravel.
+1 @kerkeslager I have to specify https://<your domain>/accounts/facebook/login/callback/ in the facebook app dashboard > Facebook Login > Settings > Valid OAuth Redirect URIs section. Fyi facebook will remove any uris that are not https for you.
Just add www in redirect_uri in your code.
Like:-
https://www.facebook.com/v3.3/dialog/oauth?client_id=427141371274449&redirect_uri=https://www.example.com/facebook-callback&scope=email&state=5f40cc740267d3-34619096-32051275-123456
Most helpful comment
The short summary is you need to whitelist
http://localhost:8000/accounts/facebook/login/callback/(replacehttp://localhost:8000with the URL of your site, includinghttps://, if you're running into this problem in production).