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?
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.
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.
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.
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.
Use this as you Site Domain: chusmix.com
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With