Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add support for CancellationToken #1239

Closed
jmprieur opened this issue Jun 3, 2021 · 1 comment
Closed

[Feature Request] Add support for CancellationToken #1239

jmprieur opened this issue Jun 3, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request fixed
Milestone

Comments

@jmprieur
Copy link
Collaborator

jmprieur commented Jun 3, 2021

Is your feature request related to a problem? Please describe.
MSAL.NET 4.32.0 brings support for: CancellationToken on GetAccountAsync, RemoveAsync and TokenCacheNotificationArgs.

 public abstract class ClientApplicationBase : IClientApplicationBase 
{
  public Task<IAccount> GetAccountAsync(string accountId, CancellationToken cancellationToken=default(CancellationToken));
  public Task RemoveAsync(IAccount account, CancellationToken cancellationToken=default(CancellationToken));
 }
    public sealed class TokenCacheNotificationArgs {
        public CancellationToken CancellationToken { get; }
    }

Describe the solution you'd like

  • Have new overrides in MsalAbstractTokenCacheProvider to support the cancellation tokens, implemented in MsalDistributedCacheAdapter. (trying avoiding a breaking change)
  • Add a CancellationToken property in TokenAcquisitionOptions and, if available use it in TokenAcquisition in calls to:
    • AcquireTokenXXX methods
    • GetAccountAsync()
    • RemoveAsync

Additional context
MSAL.NET 4.32.0 also supports:

  • .WithTenant() in all flows (which could be used instead of .WithAuthority). This would be to remove technical debt
  • WithExtraHttpHeaders on AcquireTokenXXX
@jmprieur jmprieur added the enhancement New feature or request label Jun 3, 2021
@jennyf19 jennyf19 self-assigned this Jun 3, 2021
@jennyf19 jennyf19 added this to the 1.13.0 milestone Jun 3, 2021
@jennyf19 jennyf19 added the fixed label Jun 7, 2021
@jennyf19
Copy link
Collaborator

Fixed in 1.13 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed
Projects
None yet
Development

No branches or pull requests

2 participants