I've got a few ASP.NET MVC projects burning that will be leveraging Facebook Connect for user identity and profile data.  I was impressed with how quickly I could get things running using the Facebook Developer Toolkit.  Well-documented, good examples, and the API makes sense. 

One of Connect's basic features is to provide user identity to other web applications via the "Connect Button".    Adding this feature to your ASP.NET site is already well documented by Clarity Consulting and others; here I will show you how I'm seamlessly folding this feature into the ASP.NET MVC request-handling pipeline using a custom Facebook Connect ActionFilterAttribute. 

The code for the Action Filter is pretty thin:

using System;
using System.Web;
using System.Web.Mvc;
using Facebook.Rest;
using Facebook.Session;
namespace MyWebSite.Filters
{
    public class FacebookConnectAttribute : ActionFilterAttribute
    {
        // obviously, you need to fill these in with your own application's values
        const string myFacebookApiKey = "...";
        const string myFacebookSecret = "...";
        public override void OnResultExecuting(ResultExecutingContext filterContext)
        {
            var connectSession = new ConnectSession( myFacebookApiKey, myFacebookSecret );
            if( connectSession.IsConnected())
            {
                filterContext.Controller.ViewData["FBConnected"] = true;
                var api = new Api(connectSession);
                filterContext.Controller.ViewData["FBUser"] = api.Users.GetInfo();
            }
            else
            {
                filterContext.Controller.ViewData["FBConnected"] = false;
            }
        }
    }
}

In my case, I'm making use of Facebook Connect before the controller's result is executed; e.g., before any view is resolved and rendered.  I could just as easily executed this filter before the action is executed by overriding the OnActionExecuting method.  Lines 11 and 12 contain my site's Facebook API key and secret (no prizes for guessing why I left those out of this example), which are used in line 15 to create the toolkit ConnectSession instance.  The filter can use this instance to check if the user has connected with my site and, if they have chosen to connect, fetch some of their profile data (line 20).

To place this filter into the request processing pipeline, just decorate the controller class definition with the filter attribute:

namespace MyWebSite.Controllers
{
    [HandleError]
    [MyWebSite.Filters.FacebookConnect]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
        // ... 

With the attribute in place, my Facebook Connect filter will be used during every request that invokes this controller, and the dynamic view data will contain the user's connected status and identity information:

<!-- 
    ... 
-->
<div id="logindisplay">
    <%
        if ((bool) ViewData["FBConnected"] == false) 
        {
    %>
    <fb:login-button v="2" size="xlarge" onlogin="window.location.reload();">Connect</fb:login-button>
    <%
        }
        else
        {
            var user = (user) ViewData["FBUser"];
            Response.Write("Welcome, " + user.first_name + "!");
        }
    %>
</div> 
<!-- 
    ... 
-->

The net result of this minimal effort: the entire site now has access to the user's Facebook identity and profile information once they choose to connect.

I'm still playing with the toolkit, and will hopefully have more to post soon!