CDM icon indicating copy to clipboard operation
CDM copied to clipboard

TokenProviderAsync.GetTokenAsync should accept CancellationToken

Open tovyhnal opened this issue 3 years ago • 1 comments

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}";
        }

tovyhnal avatar Sep 21 '22 11:09 tovyhnal

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.

mafrisci avatar Sep 22 '22 20:09 mafrisci

This task is being deprioritized, so I am closing this issue.

mafrisci avatar Apr 04 '23 21:04 mafrisci