Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook login, redirect_uri is not owned by the application. why?

Tags:

facebook

I can't add FB login to my site. I simply registered the application:

URL: http://www.chusmix.com/
DOMAIN: www.chusmix.com

And then I pasted the login code and replaced my APP id in it:

<html>
  <head>
  </head>
  <body>
   <div id="fb-root"></div>
      <script src="http://connect.facebook.net/en_US/all.js"></script>
      <script>
         FB.init({ 
            appId:'212044715486306', cookie:true, 
            status:true, xfbml:true 
         });
      </script>
      <fb:login-button>Login with Facebook</fb:login-button>
  </body>
</html>

However when clicking the login button I get Error 191: redirect_uri is not owned by the application

Also this code is in the page: http://www.chusmix.com/game/ according to what Facebook says filling the field DOMAIN makes all pages in the domain able to use Facebook Authorization. However I also tried pointing directly to the domain where the Login Button is and I get the same error.

There isn't even a redirect url.


Update: It seems the Login works in http://www.chusmix.com/game/ but doesn't on http://chusmix.com/game/ (without www).

Is there a way to make it work if the user doesn't type www.? Or do I have to use a redirect?

like image 236
lisovaccaro Avatar asked Apr 29 '11 17:04

lisovaccaro


People also ask

How do you solve the URL blocked this redirect failed because Facebook login error?

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 to test facebook Login localhost?

You need to register as facebook developer and create you app there. Once you have your web app registered you can go to your app and click on add product. Add Facebook Login. Then enable Web OAuth Login and add your localhost in the textfield below and save, you should be able to access it.

What is valid OAuth redirect URIs Facebook?

A valid redirect URI is the URI within your application where Facebook will send you “stuff.” Meaning, the URI within your application where Facebook may send you an authorization code and an access token.


3 Answers

Try adding the site URL to the app settings Edit Settings->Web Site->Site URL. While you are there you might as well fill in the Site Domain in case you add sub domains in the future.

like image 120
Todd Chaffee Avatar answered Oct 29 '22 13:10

Todd Chaffee


Use this as you Site Domain: chusmix.com

like image 36
ifaour Avatar answered Oct 29 '22 14:10

ifaour


Make sure every URL in your JS script matches EXACTLY to the Site URL you set up in Facebook, including http://.

Ex:

 FB.init({
      appId      : '128957350986', // App ID
      channelUrl : 'zazzlebaytobreakers.com/lib/channel.php', // Channel File

Will cause this error in IE 7 and 8.

Make sure it's:

 FB.init({
      appId      : '128957350986', // App ID
      channelUrl : 'http://zazzlebaytobreakers.com/lib/channel.php', // Channel File
like image 23
Sean Avatar answered Oct 29 '22 14:10

Sean