You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Cloud Explorer treeview can end up displaying the 'select tenant' node (shown below), and when you select it you get a message saying you only have one tenant to choose from.
The workaround is for the user to sign out and sign in again, but it is not at all obvious they need to do that.
To Reproduce
The circumstances under which this happens are:
The user was previously signed in to the AKS extension, but hasn't used it for some time.
The user's account is associated with exactly one Microsoft tenant.
The user's session is valid for listing tenants, but cannot be silently exchanged for a token for the tenant.
At this stage I'm unsure how to reproduce the last condition or the length of inactivity required to observe this, since token exchange is handled at a lower layer.
Expected behavior
If there is only one tenant to choose from, the treeview should automatically invoke any extra interaction required for the user to complete the authentication process.
Additionally, the 'select tenant' command should be made more robust. Rather than displaying an information message saying there's only one tenant, it could also invoke getAuthSession to ensure the user has a valid token for the tenant.
Additional context
To protect against this kind of bug in the future it would be worth defining more tightly what it means for a session to be "ready" and enforcing that in the API contract.
The current design is too ambiguous. By convention we avoid setting the selectedTenant property of the session if it's not possible to silently obtain a token for that tenant, but that is not enforced by the contract (consumers can set the selectedTenant to a value which violates that convention). I'll create a separate issue for some clean-up work.
The text was updated successfully, but these errors were encountered:
Describe the bug
The Cloud Explorer treeview can end up displaying the 'select tenant' node (shown below), and when you select it you get a message saying you only have one tenant to choose from.
The workaround is for the user to sign out and sign in again, but it is not at all obvious they need to do that.
To Reproduce
The circumstances under which this happens are:
At this stage I'm unsure how to reproduce the last condition or the length of inactivity required to observe this, since token exchange is handled at a lower layer.
Expected behavior
If there is only one tenant to choose from, the treeview should automatically invoke any extra interaction required for the user to complete the authentication process.
Additionally, the 'select tenant' command should be made more robust. Rather than displaying an information message saying there's only one tenant, it could also invoke
getAuthSession
to ensure the user has a valid token for the tenant.Additional context
To protect against this kind of bug in the future it would be worth defining more tightly what it means for a session to be "ready" and enforcing that in the API contract.
The current design is too ambiguous. By convention we avoid setting the
selectedTenant
property of the session if it's not possible to silently obtain a token for that tenant, but that is not enforced by the contract (consumers can set theselectedTenant
to a value which violates that convention). I'll create a separate issue for some clean-up work.The text was updated successfully, but these errors were encountered: