I've some difficulty providing a login form for authentication with onedrive.
The scenario: a Windows 7 software is made to retrieve and upload some data, a user should login into onedrive (personal onedrive) to achieve this.
According to this doc (http://msdn.microsoft.com/en-US/library/dn631823.aspx)
I should write:
var authClient = new LiveAuthClient();
LiveLoginResult result = await authClient.LoginAsync("wl.signin", "wl.skydrive");
if (result.Status == LiveConnectSessionStatus.Connected)
{
connected = true;
var connectClient = new LiveConnectClient(result.Session);
var meResult = await connectClient.GetAsync("me");
dynamic meData = meResult.Result;
updateUI(meData);
}
}
In my version (the last one) of live sdk I must optain an API key:
var _authClient = new LiveAuthClient("000xxxxxxxxxxxxxxxx"); //LiveAuthClient() simply not exist
var scopes = new string[] { "wl.signin", "wl.skydrive" }; // "wl.skydrive_update"
LiveLoginResult result = await _authClient.InitializeAsync(scopes);
if (result.Status == LiveConnectSessionStatus.Connected)
{
Debug.WriteLine("Connected");
}
The problem is that I can't find LoginAsync method and why must I obtain an API key? I'm a bit confused. Thanks.