When in November 2014 I tried to upload a video from within iMovie 9.0.9 directly to Facebook and YouTube, I encountered the same sign-in errors that others describe on this page. I was able to resolve the problem for YouTube, but not for Facebook. By the way, I’m running OS X 10.8.5.
After several failed attempts to upload to YouTube, I signed onto my YouTube account from my web browser. Once I was signed in, I saw a message, essentially a security alert, saying that someone had tried to log on to my account in an unusual way. The message contained instructions, and a link, concerning how to allow the unusual sign-in if I recognized it as legitimate. After clicking through and adjusting the security setting, I went back to iMovie and was able to upload my movie with no further problems.
I wonder whether some similar security setting in Facebook could be changed to allow iMovie to upload directly. But I haven’t yet been able to find such a setting. I notice that in my YouTube account settings, there is an option (under a heading named "Connected accounts") that allows you to link your YouTube and Facebook accounts. Maybe making this link could help to resolve the problem? But I don't intend to try it myself — maybe it will work for someone else, though. If you give it a try, or if you have any other advice or suggestions, please post to this page to let us know.