Windows Live SDK doesn't LogOut()

自作多情 提交于 2019-12-22 10:55:51

问题


Microsoft Live ID is now called Microsoft Account. Having said that, let's say I log into Windows 8 as sam@email.com and run an app.

That app uses the Live SDK to access my Microsoft Account profile. Before it can do so, however, I must give it explicit permission and log in. So far, perfect.

Though I gave the app permission to sam@email.com I want to change it to janet@email.com so I click the app's Logout button which queries LiveAuthClient.CanLogout() from the SDK. Confusingly, the SDK returns false (I cannot log out).

Why not? Once the current Windows 8 user has logged into a Windows 8 app using the Windows Live SDK, how can they log out (when CanLogOut() always returns false)? Is there a setting or something to allow this?

Turns out that this question's answer (http://stackoverflow.com/questions/13294496/can-the-windows-8-live-sdk-use-another-microsoft-account-other-than-the-current) is inaccurate.


回答1:


check your scope. if you use wl.signin, you cannot log out via code anymore because it's single sign in. Try to use wl.basic instead. More about scopes here. When you accidently used the wl.signin you have to log in your dashboard an remove the app connection by hand.




回答2:


this is the expected behaviour. Please take a look at the following link.

If the user signs in to Windows 8 with a Microsoft account or a local or domain account that is connected to a Microsoft account, providing a custom sign-out button has no effect. So the only way to have a user connect to apps with different Microsoft Accounts is if the user has not associated his Microsoft Account with Windows 8.

Hope this helps...




回答3:


Make sure you don't use "wl.signin" in your scopes. If you have been testing your app with this in, go into your account preferences for your live account and remove this option from the app's access. This will now allow more than one user to sign in.

    private LiveAuthClient authClient;

private void PhoneApplicationPage_Loaded_1(object sender, RoutedEventArgs e)
{
    this.authClient = new LiveAuthClient("yourclientidhere");
}
then you can call this.authClient.Logout(); when you want to change users.


来源:https://stackoverflow.com/questions/14491783/windows-live-sdk-doesnt-logout

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