vscode-azure-account icon indicating copy to clipboard operation
vscode-azure-account copied to clipboard

0.10.0 and 0.9.11 get VisualStudioCodeCredential mixed

Open xiaolang124 opened this issue 3 years ago • 7 comments

Azure account extension: 0.9.11 Sign in an account.

Now I update to Azure account extension: 0.10.0 My account has been removed; I must sign in again. Now I sign in another account (not the account I signed in for 0.9.11). And I use identity.VisualStudioCodeCredential(tenantId) to get credential for SqlServer, but the credential is 0.9.11 login account not 0.10.0 account. How can I get a credential of 0.10.0 account now?

xiaolang124 avatar Feb 17 '22 06:02 xiaolang124

Reproduction steps: 1.Install 0.9.11 Azure account extension. 2.Signin account1 via Azure account extension. 3.Use identity.VisualStudioCodeCredential(tenantId) to get token for SqlServer. Now I can get a token of account1. 4.Update Azure account extension to 0.10.0. 5.My account has been removed; I sign in account2 via Azure account extension. 6.Use identity.VisualStudioCodeCredential(tenantId) to get token for SqlServer. Now I still get a token of account1, not account2 token.

xiaolang124 avatar Feb 17 '22 07:02 xiaolang124

Related: https://github.com/microsoft/vscode-azure-account/issues/443

wwlorey avatar Feb 17 '22 15:02 wwlorey

Thanks for the detailed repro steps, @xiaolang124. For now please downgrade to version 0.9.11 of the extension (steps shown here) to workaround this problem.

wwlorey avatar Feb 17 '22 16:02 wwlorey

This is happening because v0.9.11 stores cache entries under the category VS Code Azure and VisualStudioCodeCredential reads from the cache directly looking for a specific cache key. The problem is: in v0.10.0 we started consuming VS Code's SecretStorage API which handles cache key names for us so the cache stored with that old key was not updated when you signed in using v0.10.0. For more info see https://github.com/microsoft/vscode-azure-account/issues/443#issuecomment-1048018144

wwlorey avatar Mar 25 '22 22:03 wwlorey

Hi @wwlorey, Would you tell me is there any plan when this will be fixed? Whether it will be automatically fixed in next version?

xzf0587 avatar Apr 28 '22 08:04 xzf0587

@xzf0587 the team is working on a long-term fix for this. We'll update the thread when it's available.

wwlorey avatar Apr 28 '22 15:04 wwlorey

@wwlorey I found the azure account extension has updated to 0.11.0. Is this problem fixed in the new version?

xzf0587 avatar Jul 18 '22 01:07 xzf0587