Django-allauth: 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.

Created on 19 May 2017  Â·  7Comments  Â·  Source: pennersr/django-allauth

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)

  1. App Domains:Empty
    4.Client OAuth Login -ON
    Web OAuth Login -ON
    5.Valid OAuth redirect URIs: http://localhost:8000/

Most helpful comment

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).

All 7 comments

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)

  1. App Domains:Empty
    4.Client OAuth Login -ON
    Web OAuth Login -ON
    5.Valid OAuth redirect URIs: http://localhost/callback

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eillarra picture eillarra  Â·  3Comments

slimaidarismail picture slimaidarismail  Â·  3Comments

peterhn picture peterhn  Â·  4Comments

hyunwoona picture hyunwoona  Â·  4Comments

FSE-DEV picture FSE-DEV  Â·  5Comments