3

Can someone please provide me with the workflow required to be able to simply post a message to my Facebook page? From what I have read, DotNetOpenAuth 4.1 does not support Facebook's OAuth 2.0 protocol? If someone has a better suggestion for an OAuth2 library, I'd like to hear it and if you can provide an example of how to post a message to a Facebook page, that'd be great!

Also, this is a Winforms application, not a Web Application.

casperOne
  • 73,706
  • 19
  • 184
  • 253
Icemanind
  • 47,519
  • 50
  • 171
  • 296
  • Try this link, might help: http://stackoverflow.com/questions/8720023/facebook-c-sharp-sdk-getting-started – David D. Sep 13 '12 at 16:31
  • You can use the [facebook-csharp-sdk](https://github.com/facebook-csharp-sdk) (also available through NuGet). (After obtaining the access tokens it's pretty straightforward) – Nasreddine Sep 13 '12 at 17:10
  • [Here's](https://github.com/facebook-csharp-sdk/facebook-winforms-sample) a working C#/WinForms sample. – Nasreddine Sep 13 '12 at 17:13
  • Guys these are all good, but should it be this complicated? Keep in mind this is my own facebook page. Can I [Authenticate As an App](https://developers.facebook.com/docs/authentication/applications/) and have an access key that lasts forever? Once I have that key, isn't there like 10 lines of code that uses [WebRequest](http://msdn.microsoft.com/en-us/library/system.net.webrequest.aspx) to post a message to my wall? – Icemanind Sep 13 '12 at 18:57
  • Why not try a http POST to graph.facebook.com with the access token. Though I'm not familiar with C#. – Donn Lee Sep 13 '12 at 19:49
  • I did. I'm getting a 403 - Forbidden response back – Icemanind Sep 13 '12 at 20:18

2 Answers2

1

OAuth2 clients are simple enough to write that you almost don't need a library. Try following the Facebook documentation yourself using HTTP calls in your winforms app and see if you can get it to work.

For client apps like winforms, the trickiest part can sometimes be that there isn't an obvious redirect URL.

DotNetOpenAuth 4.x does support Facebook (by implementing workarounds for FB's non-compliance with the spec).

Andrew Arnott
  • 80,040
  • 26
  • 132
  • 171
0

I generally use ComputerBeacon Libarary. It is quite fluent

http://computerbeacon.net/library/facebookgraphtoolkit

Paul Plato
  • 1,471
  • 6
  • 28
  • 36