Esempio n. 1
0
        /// <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;
            }
        }
Esempio n. 2
0
        /// <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.");
        }
Esempio n. 3
0
        /*********************************************************************/
        /*                    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]);
        }
Esempio n. 4
0
        /*********************************************************************/
        /*                      Insert into local store                      */
        /*********************************************************************/
        public async Task InsertLocalTokenAsync(LocalToken user)
        {
            await _localTokenTable.InsertAsync(user);

            await SyncAsync();
        }
Esempio n. 5
0
 public override void Cleanup()
 {
     CurrentUser = new LocalToken();
     base.Cleanup();
 }