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.");

アプリは少し異なるかもしれませんが、少なくともアプリとビューモデルにアクセスして、Initialized を false に設定する必要があります。ログインページを表示するために App.MainViewModel.Initialize() を期待しましたが、この SignOut メソッドを呼び出した後に更新をクリックする必要があるため、メッセージボックスを表示しました。

これがお役に立てば幸いです。

于 2014-03-25T08:18:14.360 に答える