0

I am reading a SharePoint list from Office 365 inside a Windows Phone 8 app. My app-code is based on this sample code from Microsoft. It uses

  • Microsoft.SharePoint.Phone.Application.ListDataProviderBase
  • Microsoft.SharePoint.Client.ClientContext
  • Microsoft.SharePoint.Client.Authenticator

The actual problem beeing signout not working!

On the first request to the server, the client asks for authentication and shows a hosted browser window where I can enter my account credentials. I select to stay logged in here.

If i restart the app, it authenticates me without showing the UI again.

I would like to be able to switch user or simply signout leaving no credentials on the phone behind.

I found the following static methods on Authenticator which do not change anything:

Authenticator.ClearAllCookies();
Authenticator.ClearAllCredentials();
Authenticator.ClearAllApplicationSettings();

What is the prefered way to do this?

4

1 回答 1

0

这是我如何在 WP8 的 SP 列表应用程序中注销用户的示例:

        App.MainViewModel.IsInitialized = false;
        Authenticator.ClearAllCredentials();
        App.MainViewModel.Initialize();
        MessageBox.Show("You have been successfully logged out, click refresh to login again.");

您的应用程序可能有点不同,但您至少应该将 App 和 ViewModel 设置为 false。我确实期望 App.MainViewModel.Initialize() 显示登录页面,但在调用此 SignOut 方法后需要单击刷新,这就是我显示消息框的原因。

希望这对您有所帮助。

于 2014-03-25T08:18:14.360 回答