4
votes

My Code: https://graph.facebook.com/oauth/authorize?client_id=174375686054021&redirect_uri=http://centshark.com/app/fblogin.aspx&scope=offline_access,publish_stream

Website with Facebook Login:http://centshark.com

Eror: {"error":{"message":"Invalid redirect_uri: Given URL is not allowed by the Application configuration.","type":"OAuthException","code":191}}

4

4 Answers

10
votes

in the facebook App Page, goto the basic tab. find "Website with Facebook Login" Option.

you will find Site URL: input there put the full URL ( for example http://Mywebsite.com/MyLogin.aspx ). this is the URL you can use with the call like If the APP ID is 123456789

https://graph.facebook.com/oauth/authorize?client_id=123456789&redirect_uri=http://Mywebsite/MyLogin.aspx&scope=publish_actions

2
votes

I was able to fix the problem under BASIC Tab by 'Add Platform' and 'Website' using the standard http:// site URL.

and

Going to ADVANCED Tab and under 'Security' Section placing the Site URL in the 'Valid OAuth redirect URIs' field.

2
votes

if you using Facebook PHP SDK...

in callback script need change

$accessToken = $helper->getAccessToken();

to

$accessToken = $helper->getAccessToken('https://example.com/fb-callback.php');

where 'https://example.com/fb-callback.php' it's URI to your callback script

and add this URI to "Valid OAuth redirect URIs" to "Application configuration" on Facebook->My Apps-> Settings-> Advanced

0
votes

12/3/2013: Now you need to go to the gear for settings and click on dropdown menu item "create app", use facebook as yourself (if you're not already) and then either edit or create the app you need with the right URL.