01-28-2013 03:33 PM
Seems obvious now that you've pointed it out. I saw the local URL stuff but didn't realize it was critical to the operation.
The issue with Facebook is that it requires advance knowledge of the redirect_uri if it's not hosted on one of their servers. I created a little PHP script to work around that, as per the the WebWorks sample. I guess I can do one or both of a couple things -- ensure that PHP script redirects to the correct local URL and/or use a web view.
02-21-2013 11:23 AM - edited 02-21-2013 11:34 AM
I can't to get it worked too.The library doesn't handle the authorization.
Here is my code:
KQOAuthParameters params; params.insert("scope", "publish_stream,create_event,rsvp_event,offline_ac
cess,publish_checkins"); oauthManager->setHandleUserAuthorization(true); oauthManager->getOauth2UserAuthorization(QUrl("http://m.facebook.com/dialog/oauth"), MY_APPLICATION_ID, params);
First it was unable to receive success answer from Facebook. Because it sends incorrect redirect_url paramenter. The library sets this parameter to : http://localhosl:XXXXX , where XXXXX - port number. This number always different. I changed my application settings Canvas URL to http://localhost:8080 and then change setupCallbackServer() function in library:
from : return callbackServer->listen();
to: return callbackServer->listen(QHostAddress::Any, 8080);
And now I get successfull authorization answer from Facebook. But library doesn't handle it.
What wrong? Hot to get it worked?
02-21-2013 12:40 PM
02-21-2013 02:35 PM
02-21-2013 04:17 PM
Thanks for you help! Facebook really matches host and port. You can try to open url in browser like:
with port and without ... KQOAuthManager makes request with port. If your canvas url is http://localhost, facebook returns error page.
I have it worked with my solution: run callback server on specified port and add this port to canvas url on application facebook setting page.