Login with Microsoft account using Live SDK

谁说胖子不能爱 提交于 2019-12-13 20:15:22

问题


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?


回答1:


It's not possible with LiveSdk. Because LiveSdk uses account info from the system. The only way to use few accounts at once, is to develop an own SDK via LIVE REST API (as in the LiveSDK internally).



来源:https://stackoverflow.com/questions/26693836/login-with-microsoft-account-using-live-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!