Facebook canvas app link sharing on wall gives oauth error - facebook

When I share my facebook Canvas App's link on my wall, I see the app image fine but then in the app description area I get Fatal Error: Uncaught OAuthException: An active access token must be used to query information about the current user...
Also when I debug the link the debugger says it's valid but when I try the Scraped URL I get the same error.
I understand that because I query the user in the index page of my app I get this error but how can I make facebook scraper to not give me this error.
The canvas app link is :
https://apps.facebook.com/warriorofnemesis
Thanks in advance.

I found the reason and I will answer my own question, in case somebody else faces the same problem. The reason I see this Oauth error message was , because the display_errors setting was set to true in my script. I had done it to find a error on my page and forgot that I had this setting True. After I turned it off , now it works ok.

Related

Facebook SDK - Open Graph - Share Dialog post button greyed out - error code 102

I'm following the tutorial for Publishing using the Share Dialog on the Custom Stories in iOS section.
https://developers.facebook.com/docs/ios/open-graph
When I want it too, it switches to the Facebook App, the Graph Object is presented to the user (image, title etc) for a few seconds and then disappears and Post button greys out. If I tap the Post button before it greys out, I get an error message logged:
Error publishing story: Error Domain=com.facebook.Facebook.platform Code=102
"The operation couldn’t be completed. (com.facebook.Facebook.platform error 102.)"
UserInfo=0x16d48640 {error_code=102, app_id=1435110413425124,
error_message=An error occurred during publishing.}
FYI, the standard share dialogue presentShareDialogWithLink:handler: is working fine and letting me post - it's just when I present one with a Graph Object attached to it.
I would post sample code, but it'm using the same code that's in the tutorial above. Besides, I'm pretty sure this is to do with settings in the App Dashboard, not the code I'm writing.
Per this question on Stack Overflow Facebook SDK - iOS - Fail to share URL (Error 102), I've confirmed that:
My App's Settings are set correctly in App Dashboard (including iPhone Store ID and Bundle ID)
By info.plist file is configured correctly.
This question facebook error code 102 with sdk 3.6 suggested using a real Facebook user who was an administrator of the app. I tried that, but the problem still occurred for me.
I also tried it with the App published, and with it unpublished and there was no difference.
I'm wondering if anyone else has any ideas for things I haven't checked yet?
I'm a numpty.
Despite the fact I said I'd checked the settings were correct in App Dashboard, I had misspelt the Namepsace.
If your Facebook app status is "development and unavailable to the public" will caused same result.
You may want to change it to public under "App Review" on the Facebook app menu. Or you need to login Facebook as role "Administrators", "Developers" or "Testers"

Facebook API - Fatal error: Uncaught OAuthException

I created a Facebook application, and I get this error:
Fatal error: Uncaught OAuthException: Invalid OAuth access token signature. thrown in /var/www/customers/vh-394/web/home/dev.a-soft.hu/ssl/api/facebook/xzona/sdk/src/base_facebook.php on line 1106
I'm new with developing Facebook applications and have lost the "App domain", "Site URL", "Canvas URL", "Secure Canvas URL" settings.
Probably there are some URL-settings error, but I don't know exactly how secure URLs work, and how Facebook authentication works.
Can anyone please help me about how to set these URLs above and how I can correct this error?
Thanks
EDIT:
There is a game I'd like to integrate into Facebook, so FB users can play with it, share points, etc. You can find this game here:
https://ssl.a-soft.hu/api/facebook/xzona/_index.php
If you look at this page, you can see me and some of my FB friends, but it's not real, I just learned how FB stores data in arrays so I generated them. In this file there is no connect to FB, or any FB scripts.
The real file is index.php, where everything happens. Some months ago I started to create this app using Heroku, but then I bought real ssl domain.
Anyway, the way that my app tries to connect with FB, authenticating it, is the way that Heroku uses.
So it includes "AppInfo.php", "utils.php", "FB sdk" (as Heroku), but I don't know if I failed something to use correctly.
On FB dev page, I didn't fill "App Domains" field, and under "Select how your app integrates with Facebook", I checked only "App on Facebook". In there I filled the fields exactly like this:
Canvas URL: https://ssl.a-soft.hu/api/facebook/xzona/
Secure Canvas URL: (same)
Canvas Page: apps.facebook.com/xzonahu
And now I still have the same error:
Fatal error: Uncaught OAuthException: Invalid OAuth access token signature. thrown in /var/www/customers/vh-394/web/home/dev.a-soft.hu/ssl/api/facebook/xzona/sdk/src/base_facebook.php on line 1106
Hope you can help! :)
Which URLs you need depend on exactly what kind of app you're making. Assuming you are making an app that you want embedded in the facebook frame, you should make sure that only the "App on Facebook" box is checked under "Select how your app integrates with Facebook"
You need the following URLs:
Hosting URL: This is the url where all of your resources are stored.
Canvas URL: This is the url of the page that should be displayed within the Facebook frame.
Secure Canvas URL: Secure version of the Canvas URL (making both canvas urls the same https url worked for me)
Canvas Page: This is the facebook page people visit to see your app ie. http://apps.facebook.com/myapp
All that said, there are all sorts of things that can go wrong with OAuth so if that doesn't solve the error message come back and we'll see what else it might be.

Facebook OAuth login bug

I am trying to sign in Facebook with OAuth. I use following url:
https://www.facebook.com/dialog/oauth?client_id=233884670034708&redirect_uri=http%3A%2F%2Fapps.facebook.com%2Fdemoappfbm&scope=publish_stream&response_type=token
However, I always receive following error:
An error occurred. Please try again later.
What is possible reason?
Try putting your Canvas APP Url as redirect-uri, so the actual place your app is located, not on facebook.

API Error Code: 191

yep, getting the 191 error.
I've researched and found this question to be helpful:
Facebook API error 191
My URL looks like:
https://www.facebook.com/dialog/oauth?client_id=&redirect_uri=http%3a%2f%2flocalhost%2fFb.201109Birthday%2fOAuth2.aspx
However, I get an error:
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.
I've read everywhere that the urls must match up to what's listed in the application's setting page. I've got
App Domain = localhost
Canvas Url = http://localhost/Fb.201109Birthday/Birthday.aspx?
Secure Canvas Url = http://localhost/Fb.201109Birthday/Birthday.aspx?
I've also tried local.facebook-apps.com (replaced "localhost" everywhere above with "local.facebook-apps.com") with a hosts file entry to point to 127.0.0.1. But all of these scenarios still give the 191.
Remove the Birthday.aspx from the Canvas URLs.
I was also getting this error when i created a facebook application that was going to be installed onto a tab on a fan page. It turns out that when i first created my facebook application i only filled out the section for "Page Tab" but i didn't fill out the section for "App on Facebook".
i didn't fill out the App on Facebook section because i didn't want users trying to add the app from the app profile page. Anyway, it turns out that by not filling out the App on Facebook section and adding a canvas URL and secure canvas URL i was getting the Error: 191 when trying to make a javascript call to FB.Login().
Once i filled out the App on Facebook section the error went away.
Filling up the "App on Facebook" page, with Canvas url, ended with /
solvet it for me
ex: canvas url.
above issue can be removed via providing the URL for the web site or localhost you are working on, at https://developers.facebook.com/apps/ under Edit-->Website with Facebook Login
Web forwarding occurs 191 problem.
I used web forwarding for app's domain.
I had problem 191 and solved by fixing original url.

How to do wall post in WAP based facebook mobile app?

I'm doing a facebook application for (WAP based)mobile browser. I need to show the post dialog. When i use the following code for wall post it show error.
http://m.facebook.com/dialog/feed?app_id='.$app_id.'&redirect_uri=$redirect_url&display=wap
The error is:
API ERROR CODE:3
API Error Description: Unknown Method
Error Message: This method isn't supported for this display type
While I give display type as 'touch' in the above mentioned URL it works fine in the touch devices. But no form displayed in the wap browser.
That's strange, because their documentation does mention that is the method to do it: http://developers.facebook.com/docs/reference/dialogs/
I notice an error in your PHP though (unclosed apostrophe):
It should be:
'http://m.facebook.com/dialog/feed?app_id='.$app_id.'&redirect_uri='.$redirect_url.'&display=wap'
Here is a similar issue on https://github.com/facebook/facebook-android-sdk/issues/177
Also, check out facebook's bug tracker: http://bugs.developers.facebook.net and perhaps file your bug there and then link to it from here.