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

Make AcquireTokenAsync cancellable by passing CancellationToken #635

Closed
jmprieur opened this issue Oct 11, 2018 · 5 comments
Closed

Make AcquireTokenAsync cancellable by passing CancellationToken #635

jmprieur opened this issue Oct 11, 2018 · 5 comments
Assignees
Milestone

Comments

@jmprieur
Copy link
Contributor

jmprieur commented Oct 11, 2018

Created from the corresponding feature request in ADAL.NET (ADAL.NET#1306), raised by @marnilss

Is your feature request related to a problem? Please describe.
When doing broker assisted logins (MS Authenticator) in an App, and the user cancels the login process by pressing Home button on device and then reactivating the App, the App is hung waiting for the AcquireTokenAsync to return.

Describe the solution you'd like
Make it possible to pass a CancellationToken in the request to AcquireTokenAsync

Describe alternatives you've considered
Alternatively a new method on the AuthenticationContinuationHelper, like AbortBroker(), to cancel the hanging/pending authentication call waiting for broker to reactivate with AuthenticationContinuationHelper.SetBrokerContinuationEventArgs(...).

I have found a workaround on this by crafting a special url like https://dummypath?error=...&error_description=.... and pass it to AuthenticationContinuationHelper.SetBrokerContinuationEventArgs().

Additional context
Using broker assisted (SSO) with MS Authenticator and Azure AD with ADAL i iOS app.

@bgavrilMS
Copy link
Member

@jmprieur - this is a great feature to add and should be added to all our async methods. API design standards for async APIs state that they should all have an overload taking a Cancellation Token.

@jmprieur jmprieur added this to the 2.4.0 milestone Oct 17, 2018
@jmprieur jmprieur removed this from the 2.4.0-preview milestone Nov 21, 2018
@jmprieur
Copy link
Contributor Author

@MarkZuber (for memory): something we'll do systematically with the builder-based AcquireTokenXXX

@MarkZuber
Copy link
Contributor

@MarkZuber (for memory): something we'll do systematically with the builder-based AcquireTokenXXX

@jmprieur -- agreed. I don't think a work item for full plumbing of CancellationToken was added to that work item list I sent you. Can you please add it when you file them?

@jmprieur jmprieur added the Fixed label Feb 1, 2019
@jmprieur
Copy link
Contributor Author

jmprieur commented Feb 1, 2019

Done part of MSAL 3.x

@jmprieur jmprieur added this to the 3.0 milestone Feb 8, 2019
@jennyf19
Copy link
Collaborator

Fixed in MSAL 3.0.0-preview release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants