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

Allow recovery from cancelled Azure sign-in #637

Closed
peterbom opened this issue Apr 24, 2024 · 1 comment
Closed

Allow recovery from cancelled Azure sign-in #637

peterbom opened this issue Apr 24, 2024 · 1 comment
Assignees
Labels
enhancement 🚀 New feature or request or improvements on existing code.

Comments

@peterbom
Copy link
Contributor

Is your feature request related to a problem? Please describe.

[Copied from here]
If you cancel/close the browser-based authentication for a sign-in request, subsequent sign-in attempts are left hanging indefinitely. The steps are:

  • You sign in using the "AKS: Sign in to Azure..." command
  • You select the "Sign in to another account" option (or it's your first time signing in)
  • A browser authentication window opens up
  • You close that window without completing the sign-in process

In that case VS Code thinks you're still signing in (there's no way it can be notified you've closed the browser tab). And if you try to sign in again, it waits for the original sign-in request to complete. This behaviour is part of the VS Code API and beyond our control. It is documented as a feature request in the VS Code repo, with the request being to support cancellation. The discussion suggests the request will eventually time out, but I can't find the duration documented and in any case it's a very long time. The issue has been in its current state for 3 years, so it doesn't look as if it'll see any movement anytime soon.

Mention what platform you want to support the new feature

All

Describe the solution you'd like

If it were to be fixed (i.e. the API changed to support cancellation) we could present a popup similar to the Azure Account one:
image

Describe alternatives you've considered

One thing we could do is display a cancellation dialog (like the one above), and if the user cancels we invoke the 'reload window' command. It's a bit of a sledgehammer approach, but it's currently the only way I can see for the user to get out of the trap. Reloading the window could cause users to lose context in whatever they are doing, which could cause problems for them in ways that are hard for us to predict.

As it is, I'm reluctant to make further changes at this stage, for what I hope is a relatively infrequent scenario.

Additional context

The VS Code API options are documented here. You might expect that clearSessionPreference or forceNewSession would cause VS Code to abandon its existing authentication process, but these do not have that effect.

@peterbom peterbom self-assigned this Apr 24, 2024
@Tatsinnit Tatsinnit added the enhancement 🚀 New feature or request or improvements on existing code. label Apr 26, 2024
@peterbom
Copy link
Contributor Author

peterbom commented Jun 4, 2024

Fixed in underlying VS Code repo.

@peterbom peterbom closed this as completed Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🚀 New feature or request or improvements on existing code.
Projects
None yet
Development

No branches or pull requests

2 participants