I am working on a poc using the Live Connect Rest API.
(Documentation here: http://msdn.microsoft.com/en-us/windowslive/default)
Using the example from the link below I am able to login a user and requesting consent for certain actions.
However, I have several questions related to this:
Signing in: http://msdn.microsoft.com/en-us/windowslive/hh278363#rest
Thanks!
Add this in the XAML file:
<Controls:SignInButton Grid.Row="0" ClientId="yourid" Scopes="wl.offline_access wl.skydrive_update" HorizontalAlignment="Right" VerticalAlignment="Bottom" SessionChanged="OnSessionChanged"
Margin="0,0,0,0" Width="160" Height="70" Background="Transparent" BorderBrush="{StaticResource TransparentBrush}" />
Before that, add this line to the same file:
xmlns:Controls="clr-namespace:Microsoft.Live.Controls;assembly=Microsoft.Live.Controls"
And the control will look like this:
It will automatically update as user login or sign out.
In your C# code, add the OnSessionChanged event handler to it:
private void OnSessionChanged(object sender, LiveConnectSessionChangedEventArgs e)
{
//sign in
if (e.Error != null)
{
MessageBox.Show(e.Error.Message);
return;
}
if (e.Status == LiveConnectSessionStatus.Connected)
{
((App) Application.Current).Session = e.Session;
connectClient = new LiveConnectClient(((App) Application.Current).Session);
}
}
}