public async Task SetTokenAsync(TUser user, string loginProvider, string name, string value, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            var tokenObject = new TokenEntity(user, value)
            {
                Provider = ""
            };
            TableOperation executeOperation = TableOperation.InsertOrMerge(tokenObject);

            try
            {
                await UserTokenUtility.Table.ExecuteAsync(executeOperation);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
        }
예제 #2
0
        private async Task <IdentityResult> UpdateUserTokensAsync(AzureTableUser user, string tokenValue)
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }
            var tokenObject = new TokenEntity(user, tokenValue)
            {
                Provider = ""
            };
            TableOperation executeOperation = TableOperation.InsertOrMerge(tokenObject);

            try
            {
                await UserTokenUtility.Table.ExecuteAsync(executeOperation);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            return(IdentityResult.Success);
        }