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

[@microsoft/vscode-azext-azureauth] Signing in to another account while already signed in to an account have unexpected results #1651

Open
shsuman opened this issue Dec 22, 2023 · 5 comments
Labels

Comments

@shsuman
Copy link
Member

shsuman commented Dec 22, 2023

Steps to repro:

  1. Sign In with Account A using the AzureSubscriptionProvider.signIn() method
  2. You can see all the subs of A
  3. Sign in with Account B using the AzureSubscriptionProvider.signIn() method
  4. You cannot get any subscription. It returns an empty [ ]
  5. Sign in to tenant using the signInToTenant() method. You will see a list of all the tenants of B. Pick your tenant and sign in. Note that, the tenants of B do not required any MFA and when signed in as the first step it shows all the subscriptions of B without signing in to tenant specifically
  6. You can see the subs of A instead of B.

Both 5 and 6 are not ideal. The experience should be when signing in to B, you should see the subs of B as was the case with Azure Account extension.

@alexweininger
Copy link
Member

@shsuman, I can't reproduce this scenario. If you could provide a video or screenshots that would be very helpful.

@shsuman
Copy link
Member Author

shsuman commented Jan 12, 2024

Media1.mp4

@shsuman
Copy link
Member Author

shsuman commented Jan 12, 2024

@alexweininger In the video above, account A is my Personal account, shantnusuman@hotmail.com and account B is shsuman@microsoft.com.

  • You can see that I first sign in with account A and see my subscription Visual Studio Enterprise in the tree.
  • Then I sign in using account B and I cannot see any subscription in the tree view, even after clicking the Filter subscriptions, the list is empty.
  • Then I run Sign In to directory and I can see my Microsoft tenant in the list of tenants which is the default directory of account B.
  • I think there is a deviation from what I originally described and I can see the subscriptions of B rather than A after signing in to the directory

So, I guess #6 is not an issue but #5 is still there. I have to run this additional sign in to directory to get the subs of account B.

@alexweininger
Copy link
Member

I can reproduce what you're describing, except in Azure Resources we handle this by showing a "Sign in to Directory..." item in the tree. I encourage you to do the same.

image

The section of code that adds this item is here.

As for why this is happening, I'm unsure and I'll investigate further. But for now if you add the tree item I think it should be fine as this shouldn't be a super common scenario for everyday users.

@shsuman
Copy link
Member Author

shsuman commented Feb 19, 2024

@alexweininger Any updates on this ?

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

No branches or pull requests

2 participants