Log In with Facebook on Windows 8

Just a few weeks ago, Parse launched its Windows 8 SDK, and we’ve been hard at work adding features ever since. Our latest release adds login and linking with Facebook so that your users don’t have to go through the hassle of creating yet another username and password for your apps. Getting started with Facebook login is easy!

browser.Visibility = Visibility.Visible;
try
{
    // Log in and request email and user_likes permissions from Facebook.
    ParseUser user = await ParseFacebookUtils.LogInAsync(
        browser, new[] { "user_likes", "email" });
    // The user logged in with Facebook!
}
catch
{
    // User cancelled the Facebook login or did not fully authorize.
}
browser.Visibility = Visibility.Collapsed;

Once you’ve logged in, you can use any .NET-based Facebook SDK to access your user’s Facebook data. Facebook recommends using the Facebook C# SDK, which you can install from NuGet using “Install-Package Facebook”. ¬†You can then make Facebook Graph API requests using your user’s access token like so:

var fb = new FacebookClient();
fb.AccessToken = ParseFacebookUtils.AccessToken;
var me = await fb.GetTaskAsync("me");

Take a look at our Windows guide for more information and incorporate Facebook authentication into your Windows Store app today!

 

David Poll
November 12, 2012
blog comments powered by Disqus

Comments are closed.

Archives

Categories

RSS Feed Follow us Like us