Facebook login message: "URL Blocked: This redirect failed because the redirect URI is not included in the OAuth client settings."

Important Note:

If you registered for testing, go to your profile settings and add a delete profile in your interests .

Trying to login from Facebook to my site :

I get the following error:

URL blocked: This redirect failed because the redirect URI is not in the OAuth client settings list. Make sure Client and OAuth Login is turned on and adds all your application domains as Valid OAuth URI Redirection.

My settings on Facebook:

The Advanced tab of Valid OAuth redirect URIs set to:

http://openstrategynetwork.com/_oauth/facebook?close

The application is public .

Additional settings (Optional) here: enter image description here

The key and secret of the application are correct. I use Meteor packages and its accounts.

+108
facebook oauth meteor facebook-graph-api
May 3 '16 at 9:55 a.m.
source share
13 answers

The Facebook login button on your site links to:

https://www.facebook.com/v2.2/dialog/oauth?client_id=1500708243571026&redirect_uri=http://openstrategynetwork.com/_oauth/facebook&display=popup&scope=email&state=eyJsb2dpblN0eWxlIjoicG9wdXAiLCJjcmVkZW50aWFsVG9rZW4iOiIwSXhEU05XamJjU0VaQWdqcmF6SXdOUWRuRFozXzc0X19lbVhGWUJTZGNYIiwiaXNDb3Jkb3ZhIjpmYWxzZX0=

Note: redirect_uri=http://openstrategynetwork.com/_oauth/facebook

If you instead change the link to:

redirect_uri=http://openstrategynetwork.com/_oauth/facebook?close

It should work. Or you can change the Facebook link to http://openstrategynetwork.com/_oauth/facebook

You can also add http://localhost/_oauth/facebook to valid redirect URIs.

Facebook requires you to rename the URIs to the white list, because otherwise, people could connect to Facebook for your service, and then send the access token to the attacker's server! And you do not want this to happen;]

+70
May 3 '16 at 16:22
source share

As the questioner writes

On the Advanced tab, valid OAuth redirect URIs are set to: ...

and I had the same problem (writing the redirect URL to the wrong input field), I would like to emphasize that

Is not

 Settings -> Advanced -> Share Redirect Whitelist 

but

 Facebook Login -> Settings -> Valid OAuth redirect URIs 

This would save me 2 hours of trial and error.

You should also keep in mind that www.example.com is different from example.com . Add both formats to the redirect URL.

+60
Dec 12 '17 at 13:59 on
source share

It worked for me.

redierct_url = http://127.0.0.1:8080/accounts/facebook/login/callback/

I got this from my browser after clicking the Facebook button, your browser will be redirected to a link to integrate with the Facebook API, so you will get this redirect. For my case, the link was where I got redirect_url from.

https://www.facebook.com/dialog/oauth?client_id=...&scope=&response_type=code&state=...&redirect_uri=http://127.0.0.1:8080/accounts/facebook/login/callback/

enter image description here enter image description here

+18
Oct 29 '17 at 6:27
source share

Make sure the application’s domain and Facebook Login => are valid OAuth redirect URIs . There you should check www with or without www . This is better if you use with www or without all URLs in php, html, css files and Fb application settings .

Another thing is if you use the "/" end of the URLs, you must add this URL to the application settings Valid OAuth redirect URIs . Example: - https://www.example.com/index.php/ , if this URL, if you use the redirect URL, you must set it in the application settings.

Hope this helps.

+10
Nov 27 '16 at 17:00
source share

For my Node application,

 "facebook": { "clientID" : "##############", "clientSecret": "####################", "callbackURL": "/auth/facebook/callback/" } 

put the relative url

My OAuth redirect URIs as follows

enter image description here

Make sure the "/" at the end of the Facebook authorization redirect URI

These settings helped me.

+7
Aug 05 '17 at 20:22
source share

Switching from hauth.done = Facebook to hauth_done = Facebook in valid OAuth redirect URIs fixed it for me.

+3
Feb 01 '17 at 11:14
source share

In my case, I just needed to make sure that I have URLs both with www and without it for the application domain URL and the redirect URL:

enter image description here

In my case, I had to use: signin-facebook after the URL of my site, for the redirect URL.

+1
May 10 '19 at 11:33
source share

Good. First of all, this is a very clear error message. Just see how many developers skip this, including myself. Look at the screenshot here, please.

enter image description here

Under Products> Facebook Login> Settings

or just go to this address (replace YOUR_APP_ID with the identifier of your application, lol):

 https://developers.facebook.com/apps/YOUR_APP_ID/fb-login/settings/ 

If you are working on localhost:3000 , make sure you have https://localhost:3000/auth/facebook/callback

Of course, you do not need to have real-time status (the green switch in the upper right corner), but in my case I am now deploying to heroku and will soon replace localhost:3000 with https://myapp.herokuapp.com/auth/facebook/callback

Of course, I will update the URLs in Settings / General & Settings / Advanced, and add the privacy policy URL in the main section.

I assume that you set up initializer / devise.rb correctly if you use devise and you have the correct facebook gem 'omniauth-facebook', '~> 4.0' installed gem 'omniauth-facebook', '~> 4.0' and gem 'omniauth', '~> 1.6' , and you have the necessary columns in your user table, such as uid, image, and provider. It.

+1
Jun 01 '19 at 17:14
source share

Try adding http://openstrategynetwork.com/ sigin-facebook to your OAuth client settings, with a valid redirect URL along with your own redirect URL.

0
Sep 06 '16 at 23:31
source share

Login Assistant for your site

$ loginUrl = $ helper-> getLoginUrl ('xyz.com/user_by_facebook/', $ permissions);

and in the facebook application toolbar (Products tab: Facebook login )

Valid OAuth redirect URIs must also be the same for xyz.com/user_by_facebook/

as mentioned earlier, making a request from the Internet

0
Jun 07 '17 at 21:05
source share

We had the same problem, such a nightmare.

  • Make sure your application IDs and private keys are correct. If you use separate test and test applications for testing, the application identifiers and secret keys for each application are different. This is often a problem.

  • Make sure the callback URL is set correctly in the application configuration file (see below). And then add this as the same URL in your Facebook Login settings, which says "Valid OAuth redirect URIs." It should look like this (depending on your environment):

http://localhost/auth/facebook/callback http://staging.example.com/auth/facebook/callback http://example.com/auth/facebook/callback

  1. Make sure your application domain is configured to the correct domain for each environment, including "www" and "no-www". Facebook also requires that these domains match the URL of your website or application platform. You will need to select “Add Platform” to add this.
0
Oct 10 '17 at 2:04 on
source share

In my case, I turned on my Facebook account in the Rails application tutorial. I added http: // localhost: 3000 / adsf to my actual OAuth redirect URIs, but the Rails application will open the URL as http://0.0.0.0//000 and therefore try to redirect to http://0.0.0.0{ 000/asdf . After adding http://0.0.0.0{ 000/asdf to a valid OAuth redirect URI or going to http: // localhost: 3000 / asdf , it worked as expected.

0
Nov 14 '17 at 2:27
source share

In my case, the URI as it was defined on the FB was fine, but I used Spring Security, and it added ; jsessionid = 0B9A5E71DAA32A01A3CD351E6CA1FCDD in my URI, so this caused a mismatch.

 https://m.facebook.com/v2.5/dialog/oauth?client_id=your-fb-id-code&response_type=code&redirect_uri=https://localizator.org/auth/facebook;jsessionid=0B9A5E71DAA32A01A3CD351E6CA1FCDD&scope=email&state=b180578a-007b-48bc-bd81-4b08c6989e18 

To avoid rewriting the URL, I added disable-url-rewriting = "true" to the Spring Security configuration as follows:

 <http auto-config="true" access-denied-page="/security/accessDenied" use-expressions="true" disable-url-rewriting="true" entry-point-ref="authenticationEntryPoint"/> 

And that fixed my problem.

0
Sep 01 '19 at 10:10
source share



All Articles