Facebook API error code 191 [duplicate] - facebook

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Facebook API error 191
I'm developing a Facebook app. When I attempt to get an access token, I get the following message:
An error occurred with test. Please try again later.
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration.
https://developers.facebook.com/apps/.../summary
I've configured the app's domain (appsdot.xxx.com), name and other attributes.
What is causing this error, and how do I fix it?

The redirect_uri must contain the Site URL or Canvas URL as defined in your App Settings. I always get this error when I set a redirect_uri that doesn't contain the URLs in App Settings.

I got this error because I had a trailing slash on my Canvas URL and neglected to include the trailing slash in the redirect_uri.

be carefull error is about uri (i spell: Uniform Romeo India) and the most probably you are using word url (i spell: Uniform Romeo Lima) ... do you see the difference???
just add st like this:
redirect_uri: 'YOUR_PAGE_TAB_URL OR CANVAS_URL'
how simple,isnt it?

this just because of URL mistake
whatever website url is specified should be correct.
i mentioned website url as http://localhost:3000/ and domain as localhost
but in my browser i was running http://0.0.0.0:3000/ that was the actual problem so i ran server as localhost:3000 now its working fine. Because we mentioned site url as localhost fb will redirect to same, if we r running 0.0.0.0:3000 it will rise error that Given URL is not allowed by the Application configuration.
so becarefull with your website url you have specified in facebook app.
and the url you are running locally both should match
thank you

In my case, the problem was happening because I didn't configure the site domain in the right way.
You can access your site model by the admin and change the domain name from example.com to the real domain that you are using.
The best way to fix this is create a fixture; something like:
YOUR_APP/initial_data.json:
[{"pk": 1, "model": "sites.site", "fields":
{"domain": "127.0.0.1:8000", "name": "127.0.0.1:8000"}
}]

Make sure your domain is not being masked.

The base_url must contain the Site URL or Canvas URL as defined in your App Settings. I always get this error when I set a redirect_url that doesn't contain the URLs in App Settings.

You do have to register/create the url with facebook, by creating a facebook app. You might have to give the mobile phone number to them. The Site url you put in there needs to passed as the redirect url.

rails#{This error is related to URL}
-I just put the ip address in all the URL instead of localhost..now it's working file before doing that I tried so many things but didn't work..I am sure this one will work..

Related

Facebook login error: “URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings.”

I know this question has been asked several times, but none of them are helping me. This functionality was working up until a day ago. Now I am getting this error and do not believe I have changed anything on our servers. But I know something must have changed.
Here is the url my app is trying to redirect to:
https://advocacy-test.hrmarketer.com/advocacyTest/HRmIWeb/web/facebook/auth?code=AQC6QmTOU4q__kdLDkmuqIrysoJiY1eX-HrvQtE8FeqPbOPNM22gZl4niOwEVXm_3mkBdsiYto0CnswpuLgdqbrdILIea4z1VCfpNt2CQwbfGJ61I_1QNDi7eIF3jR6Sw2JzKstcXSUi2Hydt8frN9Cg2pLrLDeSiOPgV9rO7E5O6ikhUDGAt3vYiWKb6P3nn65FPM_C5ZYczOVnYhU8Qpe8Oj4O8VTtQtR7WgayVoQP6nCldvcDjRQpnNVolJI_c_lLeTRFGQhFod-w3P_rbACRyzARxD5nYAu2jblBKHHhKQWDRD_vHl19r78mlQLPAz9M3GZcFs-xEbE2K97q_D1z&state=bdd6a2a608a7249d0cf7102fd1150341#=
When I check this in my FB app settings it says it's a valid callback uri. What could be the issue?
Redirect URI to Check
Check URI
https://advocacy-test.hrmarketer.com/advocacyTest/HRmIWeb/web/facebook/auth
check
This is a valid redirect URI for this application
From Facebook app settings
Step 1: You have to go to your code and add your URL:
$redirectUrl = "http://example.com/[auth_link]";
Step 2: Go to your Facebook App Setting and add add the exact URL above.
May be your problem is you missed WWW -> the solution add both WWW and no-WWW versionsto whitelist in Client OAuth Settings
OR you missed parameters after URL: eg: ?back=xxx

Facebook error: Site URL must use the HTTP or HTTPS protocols

I just created an app on facebook, my first time. I'm getting an error in the Basic Information. I got
Site URL must use the HTTP or HTTPS protocols.
I'm inputting "mysite.com" as said in the tutorial https://developers.facebook.com/docs/opengraph/getting-started/ i also tried inputting "www.mysite.com". I tried to input something like "http://mysite.com/" but I get the two errors displayed like this:
Error App Domains: http://mysite.com/ should not contain protocol information. Site URL must use the HTTP or HTTPS protocols.
What do I need to do here? I also tried the suggested answer in this Facebook Create New App Error - "should not contain protocol information.", but still getting either both or one of the two errors above.
The error message you are getting ("Site URL must use the HTTP or HTTPS protocols.") does not relate to the App Domain, but to the Site URL (in the "Website with Facebook Login" section).
While the App Domain must not have its protocol (HTTP or HTTPS) included, the Site URL should. See:

Facebook server-side OAuth 2.0 on localhost:8080 can't get access token missing redirect_uri

There are many other question related to this, but they didn't help me fix my problem.
I'm using the Facebook server-side login for a website, which I want to test locally. The path that initiates the login action is [http://localhost:8080/fblogin] (this redirects to the Facebook login dialogue, and goes from there).
I can successfully get the code, but when I try to exchange that for an access token, I get the following error:
{"error":{"message":"Missing redirect_uri parameter.","type":"OAuthException","code":191}}
I am providing the redirect_uri, url encoded and it is the same as the one I use to get the first code. Here is the url I'm using to request the access token (with the all-caps query string parameters replaced with their actual values, of course):
https://graph.facebook.com/oauth/access_token?client_id=CLIENT_ID&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Ffblogin&client_secret=CLIENT_SECRET&code=CODE_FROM_FB
I suspect this might have to do with how my app is set up on Facebook. Here are the values I have set:
Display Name: (an actual display name here)
App Domains: localhost
Contact email: (an actual email here)
Site URL: [http://localhost:8080/fblogin]
What do I need to tweak in the settings to get this to work? Or does this look correct?
By the way, if it makes any difference, I am using the Play! framework, version 2.0.1
After digging around a little more, I found that it was necessary for me to use POST when sending the request from my server to get the access token.
Interesting that using POST worked for you as this didn't for me.
In any case, did you add the query parameters using setQueryParameter()? (see How to make multiple http requests in play 2?)

Facebook - OAuth Token - redirect_uri isn't an absolute URL

... but it is!
I am calling the facebook API with the following link in order to receive my access token:
https://www.facebook.com/dialog/oauth?client_id=myclientid&redirect_uri=http%3A%2F%2Fmydomain.org%3A8080%2FServer%2FFacebookAuthenticationVerificationServlet&scope=manage_notifications,offline_access,read_mailbox,read_stream,publish_stream
What am I doing wrong?
Facebook answers with the following error:
message: redirect_uri isn't an absolute URI. Check RFC 3986.
type: OAuthException
code: 191
It shouldn't have anything to do with it, but I am using java's URLEncode.encode() to encode the URL into UTF-8. I compared the result with that one from JavaScript's encodeURIComponent() and didn't find any difference.
EDIT: Do I have to set the domain into my configuration? I can't locate it on "App Domains" (because facebook doesn't allow me to add domains there with port configuration) but I set the domain as "URL of my website".
EDIT2: The unencoded redirect uri: http://mydomain.org:8080/Server/FacebookAuthenticationVerificationServlet
EDIT3: This has nothing to do with the :8080. I tested it with a php-script (URL was like bla.domain.org/myphp.php) and sent the code by the php script to the tomcat server, but the error persisted.
Okay, it turned out I misunderstood the OAuth protocol. I was fetching the authorizationCode that THEN leeds me to the accessToken.
But I wasn't able to fix that error in specific. I just redeveloped the procedure and implemented auth-code and access-token separation and it works fine now.
Maybe unauthorizating the app and reauthorizating it # facebook did fix it?
Error code 191 for Facebook is
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.
Make sure mydomain.org is in the App Domains field, and that the Website with Facebook login field is correct.
You shouldn't encode redirect_uri. http%3A%2F%2Fmydomain.org is not understood as http://mydomain.org

The url supplied is invalid Facebook RestFB

I am using Facebook Graph using RestFB. When I am trying to post a URL to Facebook -
http://localhost:8080/demo
I even tried
http://www.wannaget.com/home
This is also not working. Issue was not local or live url. Because this was working previously But now it gives me invalid URL error.
It gives Following response
INFO: Facebook responded with HTTP status code 400 and response body: {"error":{"message":"(#1500) The url you supplied is invalid","type":"OAuthException","code":1500}}
I don't understand the reason why this is happening. Everything is working fine but now I am facing this issue.
The url is not in a valid format. I guess it has to end with an extension, like "http://localhost:8080/demo.html"
A workaround that worked for me (on rails):
I was trying to post on fb the link "localhost:3000/articles/53" with that same error.
To fix it I had the route:
match 'news/article/:id/x.x' => 'articles#show'
and post successfully on fb the resultant link "localhost:3000/articles/53/x.x"
Any real solution is welcome!
The URL you provided is a for a local server running on your machine. Facebook has to be able to access that URL but it can't because it is not on the Internet - it is only accessible from your local computer.
You'll have to give Facebook a real URL that is accessible by their servers...