Facebook SDK for .NET - Security Warning Issue - facebook

everyone. Today I encounter the following message in my Windows Phone App:
Success
SECURITY WARNING: Please treat the URL above as you would your password and do not share it with anyone.
This happens when my users Login through the Web Browser Control, which get the Login URL from the GetLoginUrl method from the Facebook SDK for .net. This problem is not only happening in my Apps, I've seen users from other Apps having the same problem.
Anyone found a solution to this?
I'm running this SDK in my PictureWeather (Windows Phone 7 & Windows Phone 8) and Picture2Cams (Windows Phone 8) Apps.

Had the same problem. In my app I changed this line:
parameters["redirect_uri"] = "https://www.facebook.com/connect/login_success.html";
To this line:
parameters["redirect_uri"] = "https://m.facebook.com/connect/login_success.html";
And it works now.

Had the same problem on our WP8 app using the Facebook SDK for Windows Phone (http://facebooksdk.net/docs/phone/) and the indicated solution with changing the redirect URL also worked for us.
Thanks for submitting this solution.

I ran into this problem, myself, and did a bit of digging to get to the root of the issue. The problem seems to spring from some unknown (to me, anyway) change on Facebook's side, where previously the authentication response URL was in the form
https://www.facebook.com/connect/login_success.html#access_token= ...
for some reason it now comes back from the login flow as
https://www.facebook.com/connect/login_success.html#?access_token= ...
The code in FacebookSDK.NET does a comparison in line 104 of LoginPage.xaml.cs with a simple Uri equality test
if (e.Uri == WebAuthenticationBroker.EndUri)
which fails to return true when the question mark appears in the middle. I expect Facebook will correct this on their end just because too much stuff breaks, but in the meantime a pretty clean fix is to get the FacebookClient sources from GIT instead of NuGet and change the comparison to this
UriBuilder clean = new UriBuilder(e.Uri);
clean.Query = "";
if (clean.Uri == WebAuthenticationBroker.EndUri)
The code will then run just fine, but this is seems ultimately to be Facebook's bug when checking the documentation on their developer site.
I hope this helps some others, I signed up for Stackoverflow just to make this post. :)

Use latest facebook sdk for windows phone. This issue got resolved in latest sdk. I am using Facebook.Client 0.8.2-alpha and its working great. I followed http://nuget.org/packages/Facebook.Client and http://facebooksdk.net/docs/phone/controls/login-ui-control

I guess the only way he did this was by downloading both projects from their official Github (Facebook and Facebook.Client) and reference them in your app instead of using the DLL that you can get from Nuget.
With both projects in hand, you can change this parameters on the Facebook.Client Project in the file FacebookSessionClient. Then build all the project and run.
However this solution didnt work for me too.

Related

Ionic: Disqus embed loads locally, but not in production (or on an emulator)

I've built a simple Android app, as a companion piece to a publication website, with the Ionic framework, and (after much head-banging), I managed to get the Disqus threads on the app to sync with those on the site. After trying a few different methods, I ended up going with this directive from Michael Bromley to implement the Disqus widget in the app, which is hiding behind a "Comments" button at the bottom of each article on the app's UI.
Running with Ionic Serve, everything works brilliantly. Outside of the local server: not so much. I don't get an error message from Disqus – it simply doesn't load the iframe at all. I'm refraining from posting code, because I'm wondering if this is simply a CORS issue, or maybe something simple that I'm overlooking.
One thing that might be of importance: I don't have the Crosswalk plugin installed on the app – I'm not sure if my thinking is correct, here, but could it be possible that Disqus is compatible with Chrome, which is why it runs fine when I'm testing it on my browser, but isn't compatible with Android's default browser? I'm not extremely well-read on Crosswalk, but I believe it tells the app to use a specific browser – if so, could installing it fix the problem? I'd go ahead and install it, and see if it helps, but I'd like to avoid tampering too much with an otherwise-working app if the issue is something completely unrelated to the plugins.
One weird caveat: The Disqus comments loaded on one article just fine when I tested the app on Genymotion. I deleted that article, and created a new Test article on my site (thus firing up a new Disqus thread), and that failed to render on Genymotion. It seems very... random, I guess, that it would work once. It would seem that it would either work all the time, or never work.
EDIT: While running on Genymotion, no errors appear in the console when debugging the app with WebView. The fact that I'm not getting a "Refused to load" error makes me think that Disqus is getting called and, for whatever reason, is refusing to answer the phone at all.
I can spend hours trying to figure something out, and then... well, as soon as I post a question, I end up figuring out the answer five minutes later.
I dug looked into the code for the directive I was using (which I highly recommend for anybody looking to easily implement Disqus into any AngularJS project), and I noticed that was calling for embed.js with the following string:
....
if (!$window.DISQUS) {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + scope.config.disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
} else {
....
Amending dsq.src = '//' + scope.config.disqus_shortname + '.disqus.com/embed.js';to add a protocol, making it dsq.src = 'http://' + scope.config.disqus_shortname + '.disqus.com/embed.js';fixed the issue on Genymotion. I'll ship the updated APK to the Play Store, and comment on this answer to confirm whether or not it holds up there, as well.

Facebook page is not loading properly in mx:html (Adobe AIR) outside IDE

Adobe AIR application which was working perfectly earlier; is not working now. No idea whether it is due to any recent change in Facebook or Adobe AIR.
I have added the component mx:HTML to display http://facebook.com content. In the development environment (Flash Builder 4.5) after logging in facebook successfully; I can see the TimeLine contents and updates properly. But after build when executed outside the IDE; I am able to login facebook but the timeline or updates are not being displayed properly.
Anybody facing similar issue and has a fix; please provide the solution.
uncaughtScriptException gives following two errors...
TypeError: Result of expression 'bigPipe' [undefined] is not an object.
ReferenceError: Can't find variable: console
I have similar issue, if you catch the javascript errors you will notice that facebook is using some library that fails in AIR, then if you google that exact error you will find similar issues. My solution was to use the FB API and reimplement the functionality(in my case share) , other alternatives is to fix that library or FB code to make it work. I don't remember the details but I fixed it a week ago.
Check the docs for catching the JS errors uncaughtScriptException
I am wondering if that library has code for each browser that it supports and on AIR it fails, maybe changing useragent will help, you need to check the javascript code to see where it fails

Correct way to submit a phonegap/jQM form.

very new at this. Could someone tell me what is the best method of submitting a form when using phonegap and JMQ? What I want to be able to do is passing the form data to a php file and then having the results passed back into app so that the user isnt directly accessing the php file at any point.
I found the following page link which basically does what I want but I keep getting "Origin null is not allowed by Access-Control-Allow-Origin" when testing out the code. So I'm guessing this will only work if the app is located on a server also?
Any happy would be great. thank <3
To test your solution on the computer you need to launch chrome from the terminal with the argument --disable-web-security. See this answer: Disable same origin policy in Chrome
In your Phonegap application you add a line of code to your config.xml in the www-folder: <access origin="*.yourdomain.com" />. Build, and you are now allowed to request all domains and subdomains from yourdomain.com. For more details on whitelisting see http://docs.phonegap.com/en/3.0.0/guide_appdev_whitelist_index.md.html#Domain%20Whitelist%20Guide
You are not able to make post through the local files, so Yes, you need to have it running in a Web Server.
But if you deploy your application, it should work either in a emulator or in your device.

Issues in using facebook api for ios sdk

I have downloaded the source project from
sourcecode.
I came across many issues over there, then I changed the source header path then changed the compiler version in the project settings, then all those were solved, now there is no errors, it runs, when I click FBLoginButton ,Facebook Login Dialog appeared but it looks empty,
I dont know why, The app key and app secret key were placed correctly.
I tried with device,if there would probm with simulator, still looks same.
what Im doing wrong, I had searched a lot, not found any solution, any ideas pls tell me
I have the same problem.
I have opened a bug here : https://developers.facebook.com/bugs/279606225487338
You can also vote for it, so that FB may take a look at it. Let's hope they solve it.
We had two apps in the app store which used this old api of facebook for login and they also g=have stopped working... So most probably Facebook has stopped support for this but I couldn't fond anything official. I guess we will have to incorporate the new Api.. :/ If I find something I will post here...

Has anything changed in the past ~48 hours that would break a legacy canvas app using require_login()?

Nothing has changed on my end (at least I don't think anything has), but all of a sudden I'm unable to launch my app (and users reportedly are unable to install/launch) which uses the legacy require_login() function from an old version of the PHP SDK.
When I go to apps.facebook.com/myapp, I'm brought into a redirect loop between that URL and http://mysite.com/myAppsCanvasURL.
I've Googled and found some old posts where people report similar behavior but it doesn't seem like there was any resolution, and I still have no idea what could have caused this to happen out of the blue.
Any help would be greatly appreciated.
Thanks!
dshap
Figured out the answer to my own question.
My app requires access to both the user's uploaded photos as well as the user's photo tags.
To do this, I was requesting the (previously) necessary permissions by calling:
require_login('user_photos, user_photo_video_tags');
According to this developer blog post, the "user_photo_video_tags" permission is not supposed to be deprecated until November 22nd, however if I use it right now it breaks my app - if I simply remove it, there are no issues and the app works as expected.
The weird thing is I'm not seeing any exceptions thrown, but then again I'm not seeing any exceptions thrown even if I do something like:
require_login('user_photos, fake_permission');
So maybe this has something to do with the out-dated version of the PHP SDK that I'm using.
Hopefully that helps if someone else out there is having the same problem.