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

How to cancel acquireTokenWithDeviceCode ? #2116

Open
DumTiDum opened this issue Jun 10, 2024 · 2 comments
Open

How to cancel acquireTokenWithDeviceCode ? #2116

DumTiDum opened this issue Jun 10, 2024 · 2 comments
Labels
Enhancement This is a feature request to add functionality that is not currently supported

Comments

@DumTiDum
Copy link

DumTiDum commented Jun 10, 2024

Describe the bug
I have an android-app, works with device-authentication-flow (and browser-authentication-flow). No issues, after the user logs in, I receive a token and can access my backend.

Once the user clicks log-in-via-device, I call acquireTokenWithDeviceCode. My app then shows a QR code, with the url and device-code.
MSAL starts "pinging" some backend to receive confirmation that the user has logged in. And this "pinging" continues until the user does.

However the user could choose not to log in at all (in my app, he can press back).

How do I tell MSAL to cancel the device-authentication-flow, I don't want it to keep "pinging" the backend for confirmation that the user has logged in on another device.

Expected behavior
There should be some interface to cancel the acquireTokenWithDeviceCode call. (It seems to be present on dotnet with a CancellationToken)

Actual Behavior
There is no way to stop the acquireTokenWithDeviceCode-flow other than waiting for the timeout to happen.

@negoe negoe added the Enhancement This is a feature request to add functionality that is not currently supported label Jul 16, 2024
@negoe
Copy link
Contributor

negoe commented Jul 16, 2024

hi @DumTiDum, Based on my discussion with the eng team, this is an expected behavior. We took a note of your suggested enhancement and will evaluate on our side. Thanks.

@DumTiDum
Copy link
Author

Thanks, I hope it will be added soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This is a feature request to add functionality that is not currently supported
Projects
None yet
Development

No branches or pull requests

2 participants