views:

73

answers:

1

I've done quite some research on which ASP .NET Facebook SDK to use. Acording to this post (http://msdn.microsoft.com/en-us/windows/ee388574.aspx) old FacebookToolkit should not be used for new projects but instead we should use the all new and shiny Facebook C# SDK.

But he problem is that it lacks documentation, especially beginners examples for creating Facebook applications with Facebook SDK and WebForms:

  1. How to start
  2. Basic authentication examples
  3. More examples...
  4. Where did Facebook.Web.CanvasIFrameMasterPage go from Toolkit ? :)
+1  A: 

If you want to use webforms then you should really just revise the Facebook Authentication protocol. You are going to be using the Javascript SDK to do authentication, then just making your server side calls with the SDK, of which there are examples, usually something along the lines of:

var app = new FacebookApp();
// Get the user info from the Graph API
dynamic me = app.Api("/me");
var firstName = me.first_name;

If you want to use webforms with the SDK you are going to have to do some of the legwork yourself. If you continue to struggle with Authentication I can come up with an example for you.

In fact you can even do:

var app = new FacebookApp();
var authorizer = new CanvasAuthorizer(app);
authorizer.Perms = "stream_publish";
authorizer.Authorize(this.Request, this.Response);

Which redirects the user if they are not properly authenticated or don't have the correct permissions.

BeRecursive
Thanks. What i am really looking for are some nice starter examples and best practices. I don't really want to struggle with .net authentication if Javascript SDK is preferred :). So far i've learned a few things but I still think that some basic examples and good practices would be helpful to lots of people. Maybe a list of useful links would be a great thing for a start.
zzare