CDM
CDM copied to clipboard
TokenProviderAsync.GetTokenAsync should accept CancellationToken
When we are implemeting GetTokenAsync, our implementation requires CancellationToken, which we can not pass because GetTokenAsync does not accept that.
It is a good practice to accept CancellationToken for async calls.
This is how current implementation looks like:
public async Task<string> GetTokenAsync()
{
var accessToken = await this.authenticator
.GetAccessToken(
tenantId: this.tenantId,
resource: DataLakeResource,
CancellationToken.None); // Current version of TokenProviderAsync does not support accepting cancellation token
return $"Bearer {accessToken}";
}
Hi @tovyhnal, thanks for bringing this to our attention. I have created a task for this issue, and we will provide updates as the changes are made.
This task is being deprioritized, so I am closing this issue.