I am building a Metro C# SkyDrive API on top of the Live Connect SDK (http://msdn.microsoft.com/en-us/live/default) - in Windows 8 the user has the choice to SignIn to the Windows 8 machine with either a LOCAL account, or a LIVE account.
When using the Live Connect SDK, if I call
// assume wlscopes is properly set
LiveAuthClient liveAuthClient = new LiveAuthClient();
LiveLoginResult loginResult = await liveAuthClient.LoginAsync(wlscopes);
// do some stuff on skydrive
liveAuthClient.Logout(); // <-- issue only with live account, not local
when using a LOCAL account, it logs me out (great)
When I call the same code when using a LIVE account, I get an unhanded exception -- I cannot even add a try {} catch {} around this error.
Exception:
Cannot sign out from the application since the user account is connected. (Exception from HRESULT: 0x8086000E)
Obviously since the user that is logged in under a Live account cannot logout, my api needs to detect if the current user is using a live account so I can prevent calling the logout() method.
so....My question is, how do I know which account type the user has signed in with in Windows 8?