I am creating a Windows 8.1 application, and I want to use it with multiple accounts. When I first started the application, I used the wl.signin
scope to test the app faster, but I want to test now with other account(s). So I deleted this scope, I uninstalled the app from my computer, and from my Live Account I removed the apps permissions.
Still, if I want to log in for the first time, the app wants permission for automatic login(== wl.signin
, which I deleted from my scopes already as I mentioned before).
Basically, I want to achieve to write my user credentials every time I want to use the app so I could login with other accounts.
Here is the code for login:
LiveLoginResult result = await App.Auth.InitializeAsync(new string[] { "wl.basic" });
if (result.Status != LiveConnectSessionStatus.Connected)
result = await App.Auth.LoginAsync(new string[] { "wl.basic" });
if (result.Status == LiveConnectSessionStatus.Connected)
{
await App.MobileService.LoginWithMicrosoftAccountAsync(
result.Session.AuthenticationToken);
App.Lcs = result.Session;
}
else
{
await dialogService.ShowMessage("Not logged in.", "Error!");
}
And if I try to log out, the CanLogout
always returns with false
value.
if (App.Auth.CanLogout)
{
App.Auth.Logout();
navigationService.NavigateTo("MainPage");
}
What am I missing here? Maybe the scopes cached somewhere else? Could that be a problem if I use the operating system with Microsoft Account? Or if I associated the app with a Store app with Visual Studio?