Exemplo n.º 1
0
        public async Task <bool> IsPinEntered(string clientId)
        {
            var partitionKey = PinSecurityEntity.GeneratePartitionKey();
            var rowKey       = PinSecurityEntity.GenerateRowKey(clientId);

            return(await _tableStorage.GetDataAsync(partitionKey, rowKey) != null);
        }
Exemplo n.º 2
0
        public async Task <bool> CheckAsync(string clientId, string pin)
        {
            var partitionKey = PinSecurityEntity.GeneratePartitionKey();
            var rowKey       = PinSecurityEntity.GenerateRowKey(clientId);
            var entity       = await _tableStorage.GetDataAsync(partitionKey, rowKey);

            return(entity != null && entity.CheckPassword(pin));
        }
Exemplo n.º 3
0
        public static PinSecurityEntity Create(string clientId, string pin)
        {
            var result = new PinSecurityEntity
            {
                PartitionKey = GeneratePartitionKey(),
                RowKey       = GenerateRowKey(clientId)
            };

            result.SetPassword(pin);

            return(result);
        }
        public static PinSecurityEntity Create(string clientId, string pin)
        {
            var result = new PinSecurityEntity
            {
                PartitionKey = GeneratePartitionKey(),
                RowKey = GenerateRowKey(clientId)
            };

            result.SetPassword(pin);

            return result;
        }
Exemplo n.º 5
0
        public Task SaveAsync(string clientId, string pin)
        {
            var entity = PinSecurityEntity.Create(clientId, pin);

            return(_tableStorage.InsertOrReplaceAsync(entity));
        }