I've a small app running on WP8.1 RT, which uses Live SDK to connect with Onedrive. Basically the code goes like this:
string[] scopes = new string[] { "wl.signin", "wl.skydrive", "wl.offline_access" };
authClientOnedrive = new LiveAuthClient();
LiveLoginResult loginResult = await authClientOnedrive.InitializeAsync(scopes);
if (loginResult.Status != LiveConnectSessionStatus.Connected)
await authClientOnedrive.LoginAsync(scopes);
clientOnedrive = new LiveConnectClient(authClientOnedrive.Session);
This works just fine, as I've wl.offline_access I get refresh tokens. As I've read tokens should be valid for a year.
But what to do when I get an exception The access token that was provided has expired.
?
One of my users now has such a situation and I must say that I miss information what to do in such case, when using Live SDK api - as I've tried the authClient.CanLogout is always false and I cannot Logout() to sign in again. Does anybody knows something about this situation? Do I need to use REST api for this?