OneDrive / onedrive-sdk-csharp

OneDrive SDK for C#! https://dev.onedrive.com
Other
294 stars 143 forks source link

SignOut not working #211

Closed minimalisticMe closed 7 years ago

minimalisticMe commented 7 years ago

Hi,

I'm using UWP Microsoft.OneDriveSDK 2.0.6 and Microsoft.OneDriveSDK.Authentication 1.0.8.

When I log into my profile with a scope via

var onlineIdAuthProvider = new OnlineIdAuthenticationProvider(scopes);
authTask = onlineIdAuthProvider.RestoreMostRecentFromCacheOrAuthenticateUserAsync();
oneDriveClient = new OneDriveClient(oneDriveConsumerBaseUrl, onlineIdAuthProvider);
AuthProvider = onlineIdAuthProvider;

everything works fine. I can access everything I need and I'm happy with it.

However, when I try to log out, with await AuthProvider.SignOutOfBrowserAsync();, I get the following appears: zwischenablage01

German for something like "Your request couldn't be finished. Some technical problems occurred with your Microsoft account. Please try again later." (no error on code side).

When I start the app the next time, the user does not need to take actions in order to login again, but is still logged, as if the logout never was called.

Same goes for await AuthProvider.SignOutAsync();, but there no message (like above) appears.

So this is technical two things:

  1. The message above should not appear
  2. How do I log out correctly?
daboxu commented 7 years ago

hi @minimalisticMe I searched for a while and found probably it is due to Windows 10 use new auth story: https://msdn.microsoft.com/en-us/library/windows/apps/windows.security.authentication.onlineid.onlineidauthenticator. I would encourage you use the original MsaAuthenticator rather than the OnlineIdAuthenticator because it is outdated a little bit.