Esempio n. 1
0
 /// <summary>
 /// Removes the authorization code from the store with a given key
 /// </summary>
 /// <param name="key">The key of the authorization code</param>
 public async Task RemoveAsync(string key)
 {
     var entity = new TokenTableEntity
     {
         PartitionKey = key.GetParitionKey(),
         RowKey       = key,
         ETag         = "*"
     };
     var op = TableOperation.Delete(entity);
     await _table.Value.ExecuteAsync(op);
 }
Esempio n. 2
0
 /// <summary>
 /// Removes the token from the store with a given key
 /// </summary>
 /// <param name="key">The key of the token</param>
 public async Task RemoveAsync(string key)
 {
     var entity = new TokenTableEntity
     {
         PartitionKey = key.GetParitionKey(),
         RowKey       = key,
         ETag         = "*"
     };
     var op = TableOperation.Delete(entity);
     await _retryHelper.Try(() => _table.Value.ExecuteAsync(op)).UntilNoException();
 }
Esempio n. 3
0
 /// <summary>
 /// Saves the authorization code with its given key
 /// </summary>
 /// <param name="key">The key for the authorization code</param>
 /// <param name="value">The authorization code to serialize and store</param>
 public async Task StoreAsync(string key, AuthorizationCode value)
 {
     var entity = new TokenTableEntity
     {
         PartitionKey = key.GetParitionKey(),
         RowKey       = key,
         ClientId     = value.ClientId,
         Json         = ToJson(value),
         SubjectId    = value.SubjectId
     };
     var op = TableOperation.InsertOrReplace(entity);
     await _table.Value.ExecuteAsync(op);
 }
Esempio n. 4
0
 /// <summary>
 /// Saves the token with its given key
 /// </summary>
 /// <param name="key">The key for the token</param>
 /// <param name="value">The refresh token to serialize and store</param>
 public async Task StoreAsync(string key, Token value)
 {
     var entity = new TokenTableEntity
     {
         PartitionKey = key.GetParitionKey(),
         RowKey       = key,
         ClientId     = value.ClientId,
         Json         = ToJson(value),
         SubjectId    = value.SubjectId
     };
     var op = TableOperation.InsertOrReplace(entity);
     await _retryHelper.Try(() => _table.Value.ExecuteAsync(op)).UntilNoException();
 }