/// <summary>
 /// Removes the consent for a subject and client
 /// </summary>
 /// <param name="subject">The subject</param>
 /// <param name="client">The client</param>
 /// <returns></returns>
 public async Task RevokeAsync(string subject, string client)
 {
     var entity = new ConsentEntity
     {
         PartitionKey = subject,
         RowKey = client,
         ETag = "*"
     };
     var op = TableOperation.Delete(entity);
     await _table.Value.ExecuteAsync(op);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Updates the consent for a subject and client.
 /// </summary>
 /// <param name="consent">The consent</param>
 /// <returns></returns>
 public async Task UpdateAsync(Consent consent)
 {
     var entity = new ConsentEntity
     {
         PartitionKey = consent.Subject,
         RowKey       = consent.ClientId,
         Scopes       = string.Join(",", consent.Scopes)
     };
     var op = TableOperation.InsertOrReplace(entity);
     await _retryHelper.Try(() => _table.Value.ExecuteAsync(op)).UntilNoException();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Removes the consent for a subject and client
 /// </summary>
 /// <param name="subject">The subject</param>
 /// <param name="client">The client</param>
 /// <returns></returns>
 public async Task RevokeAsync(string subject, string client)
 {
     var entity = new ConsentEntity
     {
         PartitionKey = subject,
         RowKey       = client,
         ETag         = "*"
     };
     var op = TableOperation.Delete(entity);
     await _retryHelper.Try(() => _table.Value.ExecuteAsync(op)).UntilNoException();
 }
Exemplo n.º 4
0
 /// <summary>
 /// Removes the consent for a subject and client
 /// </summary>
 /// <param name="subject">The subject</param>
 /// <param name="client">The client</param>
 /// <returns></returns>
 public async Task RevokeAsync(string subject, string client)
 {
     var entity = new ConsentEntity
     {
         PartitionKey = subject,
         RowKey       = client,
         ETag         = "*"
     };
     var op = TableOperation.Delete(entity);
     await _table.Value.ExecuteAsync(op);
 }
 /// <summary>
 /// Updates the consent for a subject and client.
 /// </summary>
 /// <param name="consent">The consent</param>
 /// <returns></returns>
 public async Task UpdateAsync(Consent consent)
 {
     var entity = new ConsentEntity
     {
         PartitionKey = consent.Subject,
         RowKey = consent.ClientId,
         Scopes = string.Join(",",consent.Scopes)
     };
     var op = TableOperation.InsertOrReplace(entity);
     await _table.Value.ExecuteAsync(op);
 }