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?

fabsenet
  • 372
  • 2
  • 15

1 Answers1

0

This is an example of how I am logging out a user in my SP list App for WP8:

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

Your app maybe a little different, but you should at least get to the App and ViewModel to set Initialized as false. I did expxect the App.MainViewModel.Initialize() to show the login page but need to click refresh after calling this SignOut method to do so, that is why I displayed the messagebox.

Hope this helps you.

JeffreyJ
  • 99
  • 2
  • 12
  • After signout, if the user logins again, is he prompted for his login credentials? – fabsenet Mar 28 '14 at 10:44
  • Yes, it seems to be working as expected. On refresh or sync of the page after the above code has been executed the user is prompted to login again. – JeffreyJ Jul 10 '14 at 09:15