public async Task <bool> AutoLogin() { try { LiveConnectSession Session; this.handler = new RefreshTokenHandler(); this.LiveAuthClient = new LiveAuthClient(this.ClientID, this.handler); LiveConnectSession s = this.LiveAuthClient.InitializeAsync().Result.Session; if (this.handler != null) { Session = s; this.liveConnectClient = new LiveConnectClient(Session); return(true); } else { Session = null; return(false); } } catch (Exception) { } return(false); }
public void clearClients() { this.LiveAuthClient = null; this.liveConnectClient = null; this.handler = null; }
public async Task<bool> AutoLogin() { try { LiveConnectSession Session; this.handler = new RefreshTokenHandler(); this.LiveAuthClient = new LiveAuthClient(this.ClientID, this.handler); LiveConnectSession s = this.LiveAuthClient.InitializeAsync().Result.Session; if (this.handler != null) { Session = s; this.liveConnectClient = new LiveConnectClient(Session); return true; } else { Session = null; return false; } } catch (Exception) { } return false; }