Facebook application type web goes 104 Incorrect signature

When creating flash / flex application for facebook, Application Type “Desktop” will work for you just fine, even when your app is deployed. My app is both embedded via iframe in facebook and standalone application (not in facebook). First I tought desktop mode is just to test my app locally and when finished, I should switch to web type. But guess what, after switching to “Web” type, my standalone application refused some actions (upload photos etc.), resulting in error:

error_code: 104
error_msg: Incorrect signature

So, I switched back to “Desktop” and both iframe and standalone applications works fine. :-) Correct me if I am wrong, but it seems, desktop application type works for facebook flash / flex api in all cases.

35 comments so far

  1. Jessica November 9, 2009 23:45

    The same happens to me, I have wasted lots of time so far and still don’t know what’s wrong :(

    When I access the flex application from facebook everything’s alright, but when I try to access it from an html page on my server it throws error 104 “Incorrect signature”

  2. Jozef Chúťka November 10, 2009 15:15

    switch your application type to “Desktop”
    facebook / developer / see my applications / your app / edit settings / advanced / advanced settings / application type = “Desktop”

  3. Jessica November 13, 2009 01:04

    Thanks for your reply, that’s ok for “Desktop” applications, but my application is a web application (not a canvas accessed from facebook), so that won’t work.

    I’ve tried other calls, like:
    *ALWAYS require a session key
    -GetAppUsers (works)
    -GetAlbums (works)
    -GetPhotos (works)

    *Don’t require a session key, but offer additional functionality if one is passed
    -CreateAlbum (works)
    -UploadPhoto (DOESN’T WORK, throws “Incorrect signature”)

    Any suggestions? I don’t understand why UploadPhoto is the only method that has this problem, even the methods that require a session key work, so the session key must be ok.

    I still can’t figure it out .. =/

  4. Jozef Chúťka November 13, 2009 10:26

    Hi, it does not matter that is in or out of fb, desktop type works for both. So I suggest try switch app type to desktop, wait 2 minutes, refresh flash app and try again. If not working:
    - are you using latest framework (flash or flex?)
    - does it work when debugging (from local)?
    - do you use user interaction (click) to call UploadPhoto?
    - are you connected on fb as an user who has acces to your fb app?
    - try laborate with fb app settings. see settings I use for apps on http://blog.yoz.sk/2009/10/fb-connect-showpermissiondialog/ (image on bottom of the article)

  5. Jessica November 13, 2009 21:48

    You were so right! I tried “Desktop” for my web application and it worked both as an iframe accessed from facebook and also from a web page outside of facebook.

    I still wonder the reason for this, because as I get it, “Desktop” is for desktop apps and “Web” is for web apps. Anyway this works.

    If I find a way to change the setting to “Web”, I’ll let you know. Thanks for everything! :)

  6. Jozef Chúťka November 14, 2009 09:07

    yeah, that is the same what I tought about app type too, so I made this article. Now I think web type is just for server side languages…

  7. Adam November 21, 2009 01:53

    Hey guys. Had this problem too this week, and took us days to find the solution! We tried every way possible (i.e: Web, Desktop, both with iFrame, and FBML pages) and for each printed out the facebook data returned. From this we realised the solution.

    Embed the Flex app (SWF) in too FBML using . Set the app to Web, using a php file (php for login, checking if user has app added etc..) with the fbml included below which has the swf tag in there. Doing this, sent the app a secret session key to the swf, allowing photos to upload!!!

    Hope this helps you guys.

  8. Adam November 21, 2009 01:55

    I should confirm, when i say ‘sent the app’, i mean facebook could then send the SWF the secret session key (not the secret api key) to it. Remeber this only worked using the FB:SWF and not FB:Iframe or similar

  9. Sara April 28, 2010 03:22

    Hi guys

    I had this error also.but what makes me crazy that when I used publish stream or upload photo it’s work fine but when i used upload video this error occurred,, do u have any idea if there is anything else could cause this error??

    I also tried to change from web to desktop but nothing change.

    please I need ur help

    thanks in advance

  10. Jozef Chúťka April 28, 2010 09:41

    Hi Sara,
    - do you use old rest api or graph api?
    - did you granted appropriate permissions to your app (publish_stream)?
    - this one is lame, but there are some days (like April 27, 2010) when facebook has just a bad day and nothing works as is should. Yeah, yesterday I was challenging even to get my pforile album :-) … so try today

  11. Sara April 28, 2010 15:32

    Hi Jozef

    Thank u for ur fast response.
    I’m using old rest api,and I already granted the permission

    yaa ur rigth,it was a very bad day for facebook and for me also :p

    I try it today,but also I got the same thing.

    its look like that facebook had too many bad days in these days.

  12. Jozef Chúťka April 28, 2010 17:41

    there are some other things mentioned on http://wiki.developers.facebook.com/index.php/Video.upload
    - You must make the video.upload call to http://api-video.facebook.com, and not api.facebook.com. If you call api.facebook.com, an error gets returned. – check that out
    - try also video_upload permission (even though it should be contained in publish_stream)

    If you still do not succeed try facebook developers forum on http://forum.developers.facebook.com/ …I do not have personal experience with video upload thus I may not tell you correct way

    have a nice one

  13. Sara April 28, 2010 20:17

    Thank u very much,, I really appreciate ur help

  14. Mike May 1, 2010 15:36

    When uploading a picture to facebook. How do you generate the signature ? what do you include in it ?

    Thanks.

  15. Jozef Chúťka May 3, 2010 14:29

    well, authorization/signature handles public libraries. You can use client side or server side one. I personaly use:
    Actionscript 3.0 Client for the Facebook Platform API
    http://code.google.com/p/facebook-actionscript-api/

    or PHP SDK for the Facebook API
    http://github.com/facebook/php-sdk

  16. Mike May 6, 2010 17:43

    Thanks Jozef. I tried using (in actionscript):

    var call:FacebookCall = fbook.post(new GetAlbums(id));

    and no result is returned. I made a facebook account and put some pictures in it, stored them in an album and made them public. All other calls (user info…) work ok. NO difference is Desktop or web is selected as type of application.

    Any idea why no data is returned ?

  17. Jozef Chúťka May 7, 2010 10:27

    Hi Mike,

    GetAlbums() works ok, you can try it on http://onboard.yoz.sk tool “insert facebook photo”, there you get list of albums for your friends…

    request vars on http://api.facebook.com/restserver.php:
    v: 1.0
    method: photos.getAlbums
    api_key: e534946c9cdfc2ffe94f16c1a97db15b
    call_id: 12732203790464
    uid: 100000505022282
    session_key: 2.0kXZY…….
    sig: e90d3ff500f5c9a171f1fd671ff59f1e

    returns:
    <photos_getAlbums_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
    <album>
    <aid>...

    it may happen (and really does sometimes) that facebook api does not work correctly for custom uids, but it often fix itself next day or so... try your app today

  18. Mike May 9, 2010 19:41

    I am basically using the facebook/actionscript API:

    function getPhotos()
    {
    var call:FacebookCall = fbook.post(new GetAlbums(fbook.uid));
    call.addEventListener(FacebookEvent.COMPLETE, handleGetAlbumsResponse);
    }

    function handleGetAlbumsResponse(e:FacebookEvent):void {
    var albumsResponseData:GetAlbumsData = e.data as GetAlbumsData;
    }

    When the function/callback is called albumsResponseData.albumCollection.length is 0 regardless of uid used (my account or friends of my account). These calls are made after logging in to the account…other calls like getfriends…work ok.

    Any ideas ? is There any parameter missing…?

    Thanks,

  19. Mike May 9, 2010 20:08

    If you try the sample in the link below using your own key and secret, do you get a list of albums ?

    http://hybridhacking.com/tutorials/building-facebook-applications-with-flex

    Thanks,

  20. Jozef Chúťka May 10, 2010 14:56

    Hi Mike, your code looks ok however, you should use albumCollection.source.length instead of albumCollection.length

    private function handleGetAlbumsResponse(event:FacebookEvent):void
    {
    var albumsData:GetAlbumsData = GetAlbumsData(event.data);
    var albumCollection:AlbumCollection = albumsData.albumCollection;
    if (albumCollection.source.length > 0)
    {

  21. Mike May 10, 2010 20:25

    Thanks Jozef,

    albumCollection.source.length still returns 0. When clicking on friends to get their public photos, it gets 0 as well. It may be something to do with permissions…but I have given application permission (everyone) or the user id…
    Within Facebook, under Photos -> My Uploads , there are some albums with photos in them and published.

    http://hybridhacking.com/tutorials/building-facebook-applications-with-flex also returns no data.

  22. Jozef Chúťka May 11, 2010 12:16

    I have no idea what can be the issue Mike, maybe some beg… try also graph api http://blog.yoz.sk/2010/05/facebook-graph-api-and-oauth-2-and-flash/

  23. Mike May 13, 2010 15:45

    Above, where does the number ” uid: 100000505022282 ” come from ? is the uid the user id , the 9-digit number ?

    Thanks,

  24. Jozef Chúťka May 13, 2010 16:39

    hi Mike, yes, uid is your facebook.uid (id of your profile), in this case my testing account. pst. facebook uses 64bit integers, but you should work with them as strings because actionscript works with 32bit ints.

  25. Kit May 15, 2010 07:29

    Hi,
    I get a problem on connect to to facebook.
    Here is my code
    session=new FacebookSessionUtil(API_KEY,SECRET,stage.loaderInfo);
    fbook=session.facebook;
    session.addEventListener(FacebookEvent.CONNECT,onConnect);
    session.addEventListener(FacebookEvent.WAITING_FOR_LOGIN,onWaitLogin);
    session.login();

    and it only return Error code 104 and said Incorrect signature. Even I change the application type to “Desktop”.
    I am using Facebook library v3.4 flex.
    Hope someone can help me.
    Thx a lot

  26. Jozef Chúťka May 15, 2010 09:47

    Hi Kit, please double check your facebook app settings against this eg. model:
    Connect URL: http://blog.yoz.sk/examples/FacebookOAuthGraph/
    Base Domain: yoz.sk
    FBML/iframe: iframe
    Developer Mode: Off
    Application Type: Desktop
    Private Install: No

    - check your api key and secret used in flash project
    - if still no success, try trace your requests with proxy ( http://www.charlesproxy.com/ ) and see whats going wrong
    - try use this logger class, it handles some important things for you http://blog.yoz.sk/2009/12/facebooklogger/

  27. Kit May 15, 2010 21:05

    Thx, I solved my problem because I had set the developer mode to on.
    Thx again.

  28. Jozef Chúťka May 18, 2010 00:31

    I guess this have had something to do with your latest issues:

    Signature verification error
    May 11, 2010 9:14pm
    Currently about 10% of API calls fail due to signature verification error (104). We are currently pushing the fix to the servers and the errors should be resolved as soon as th

    Signature verification error — resolved
    May 11, 2010 10:20pm
    The aforementioned issue with inappropriate “invalid signature” responses has now been resolved.

  29. Eby November 12, 2011 18:42

    hey

    i changed mine to desktop but still i am getting the same error

  30. Eby November 12, 2011 19:16

    hey if i update status as a normal english word no problem but is i use hindi letters i am geting errors

  31. Assdres November 30, 2011 20:25

    Put this before your code:

    FB.init({
    appId : ‘your_app_id’,
    status : true, // check login status
    cookie : true, // enable cookies to allow the server to access the session
    xfbml : true // parse XFBML
    });

  32. brianna peral February 17, 2012 08:15

    I have the Facebook app for Android and I log in and it says error occurred while fetching data 104 incorrect signature, how can I fix this? Facebook isn’t doing anything for me. Please help me.

  33. Jozef Chúťka February 20, 2012 10:41

    hi Biranna, as you can see the article is more than 2 years old. I believe you use totaly different approach on android than I used when writing this article. All I can suggest is have a look at the article again and comments below, maybe something may help you

  34. Raja February 29, 2012 14:30

    Hi,I have develop desktop application, the main purpose upload images to facebook.I’m new in the development of facebook application can you suggest to my application. i got api key, securt key and also session key. but stil i struggle uploading image.

  35. Raja March 28, 2012 07:33

    Hi… I got session key and also upload images to my Facebook Wall but i cant upload images to my friends wall, can you give me suggestion to upload images to my friends wall.

Leave a comment

Please be polite and on topic. Your e-mail will never be published.