Building an application that uses the LiveFX is easy. So is building an application that uses Windows Live ID. Using the Windows Live ID Client SDK also means that you’re not asking a user to supply your application with the username and password which means that the user can remain safe that they’re not just giving out their username and password for the program to with as he wishes. So if both sorts of programs are easy, is it easy to combine the two? Well, yes.
In Visual Studio, I created a quick Windows Form that looks like the following:

In the references, we need the following:

To start off with, let’s initialise the program:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsLive.Id.Client;
using Microsoft.LiveFX.Client;
using Microsoft.LiveFX.ResourceModel;
namespace LiveFXBrowser
{
public partial class frmMain : Form
{
private const string baseUri = "https://user-ctp.windows.net/";
private LiveOperatingEnvironment loe = new LiveOperatingEnvironment();
private IdentityManager idmgr;
private Identity id;
public frmMain()
{
InitializeComponent();
try
{
// Create an instance of the ID Manager for the WLID Client
idmgr = IdentityManager.CreateInstance("ScottIsAFool;wlm@scottisafool.co.uk;LiveFX Browser", "LiveFX Browser");
id = idmgr.CreateIdentity();
}
catch
{
// TODO: Something
}
}
Then, let’s look at the code for when we click on the sign in button:
private void llSignInSignOut_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if (!id.IsAuthenticated)
{
// Load the WLID Sign in window
id.Authenticate();
if (id.IsAuthenticated)
{
// Create the Uri for the LiveFX
Uri uri = new Uri(baseUri);
// Get the authenticated token for the user for LiveFX
string token = id.GetTicket("user-ctp.windows.net", "MBI_SSL", true);
// Connect to the LiveFX
loe.Connect(token, AuthenticationTokenType.UserToken, uri, new LiveItemAccessOptions(true));
// Set the footer status and sign in text to indicate signed in.
tsStatusFooter.Text = "Signed in as: " + loe.Mesh.ProvisionedUser.Name + ".";
llSignInSignOut.Text = "Sign out";
Profile prof = loe.Profiles.Entries.Single(p => p.Resource.Title == "GeneralProfile");
var _messengerPSM = (GeneralProfile)prof.Resource.ProfileInfo;
txbxMessengerPSM.Text = _messengerPSM.PersonalStatusMessage;
}
}
else
{
// Close the WLID session
id.CloseIdentityHandle();
tsStatusFooter.Text = "Not signed in";
llSignInSignOut.Text = "Sign in.";
}
}
As you can see, the code is similar from both previous projects. The comments in the code should be self explanatory.
The finished program and steps, look like the following:

![LiveFXWLIDClientStep2[4] LiveFXWLIDClientStep2[4]](http://www.liveside.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/developer/LiveFXWLIDClientStep2_5B00_4_5D005F00_17921AF2.png)

And there you have it.
If you want to check this out, the source (and the built app) are available from my SkyDrive area.
Download
Sign In 
using Live ID,
Name/Password, or
OpenID
or
Join LiveSide
to leave a comment!