/// <summary> /// Attempts to retrieve a prior user token /// </summary> public static async Task RetrieveToken(LocalStorageService storage) { LocalToken tokenObj = await storage.GetItemAsync <LocalToken>("token"); if (tokenObj != null) { UserSecretToken = tokenObj.Token; } }
/// <summary> /// Stores the current user token /// </summary> public static async Task StoreToken(LocalStorageService storage) { LocalToken tokenObj = new LocalToken() { Token = UserSecretToken }; await storage.SetItemAsync("token", tokenObj); Console.WriteLine("Stored user token in local storage."); }
/*********************************************************************/ /* Get the Azure login credentials */ /*********************************************************************/ public async Task <AzureToken> GetAzureTokenAsync(LocalToken currentUser) { //APPARENTLY THIS DOES NOT WORK PROPERLY await _azureTokenTable.PullAsync("loginUser", _azureTokenTable.Where(user => user.Id == currentUser.Id)); List <AzureToken> _tokenList = await _azureTokenTable.Where(user => user.Id == currentUser.Id).ToListAsync(); //DELETE THE LOGIN INFORMATION await _azureTokenTable.PurgeAsync(); return(_tokenList[0]); }
/*********************************************************************/ /* Insert into local store */ /*********************************************************************/ public async Task InsertLocalTokenAsync(LocalToken user) { await _localTokenTable.InsertAsync(user); await SyncAsync(); }
public override void Cleanup() { CurrentUser = new LocalToken(); base.Cleanup(); }