vscode: "Current session is expired" immediately after signing in
Testing #229414
- Enable settings sync using my work account
- Sign out of it in vscode
- Sign out of it in the browser (is there any other way to switch to a different microsoft account, or to enable settings sync using my github account? Otherwise at this point it only wanted to use the same microsoft account)
- Enable settings sync again, sign into my personal microsoft account
- Get this notification
It worked after clicking that button and doing the flow again
Microsoft Authentication log (I think this covers signing into work microsoft again, then signing out, then signing into personal microsoft. It might not be that exact flow, sorry)
2024-09-24 12:17:55.913 [info] [createSession] [email offline_access openid profile] starting
2024-09-24 12:17:55.913 [info] [Tue, 24 Sep 2024 19:17:55 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-node@2.13.1 : Info - getTokenCache called
2024-09-24 12:17:56.031 [info] [Tue, 24 Sep 2024 19:17:56 GMT] : [74281b4f-3845-4eaf-8b9f-c9496b58add8] : @azure/msal-node@2.13.1 : Info - getAuthCodeUrl called
2024-09-24 12:17:56.032 [info] [Tue, 24 Sep 2024 19:17:56 GMT] : [74281b4f-3845-4eaf-8b9f-c9496b58add8] : @azure/msal-node@2.13.1 : Info - Building oauth client configuration with the following authority: https://login.microsoftonline.com/organizations/oauth2/v2.0/token.
2024-09-24 12:17:56.923 [info] [Tue, 24 Sep 2024 19:17:56 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-node@2.13.1 : Info - acquireTokenByCode called
2024-09-24 12:17:56.923 [info] [Tue, 24 Sep 2024 19:17:56 GMT] : [74281b4f-3845-4eaf-8b9f-c9496b58add8] : @azure/msal-node@2.13.1 : Info - Building oauth client configuration with the following authority: https://login.microsoftonline.com/organizations/oauth2/v2.0/token.
2024-09-24 12:17:57.419 [info] [Tue, 24 Sep 2024 19:17:57 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-node@2.13.1 : Info - getTokenCache called
2024-09-24 12:17:57.422 [info] [createSession] [email offline_access openid profile] returned session
2024-09-24 12:17:57.424 [info] [Tue, 24 Sep 2024 19:17:57 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-common@14.14.2 : Info - CacheManager:getIdToken - Returning ID token
2024-09-24 12:17:57.425 [info] [getSessions] [email offline_access openid profile] starting
2024-09-24 12:17:57.425 [info] [Tue, 24 Sep 2024 19:17:57 GMT] : [f27418b1-9d3a-4954-b39d-7210ea4e102e] : @azure/msal-node@2.13.1 : Info - Building oauth client configuration with the following authority: https://login.microsoftonline.com/organizations/oauth2/v2.0/token.
2024-09-24 12:17:57.426 [info] [Tue, 24 Sep 2024 19:17:57 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-common@14.14.2 : Info - CacheManager:getAccessToken - Returning access token
2024-09-24 12:17:57.426 [info] [Tue, 24 Sep 2024 19:17:57 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-common@14.14.2 : Info - CacheManager:getIdToken - Returning ID token
2024-09-24 12:17:57.426 [info] [getSessions] [email offline_access openid profile] returned 1 session(s)
2024-09-24 12:17:57.426 [info] [getSessions] [email offline_access openid profile] starting
2024-09-24 12:17:57.426 [info] [Tue, 24 Sep 2024 19:17:57 GMT] : [7aa863ce-59ab-4cd4-bea9-3fc8c8dc1240] : @azure/msal-node@2.13.1 : Info - Building oauth client configuration with the following authority: https://login.microsoftonline.com/organizations/oauth2/v2.0/token.
2024-09-24 12:17:57.427 [info] [Tue, 24 Sep 2024 19:17:57 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-common@14.14.2 : Info - CacheManager:getAccessToken - Returning access token
2024-09-24 12:17:57.427 [info] [Tue, 24 Sep 2024 19:17:57 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-common@14.14.2 : Info - CacheManager:getIdToken - Returning ID token
2024-09-24 12:17:57.427 [info] [getSessions] [email offline_access openid profile] returned 1 session(s)
2024-09-24 12:18:23.983 [info] [getSessions] [all] starting
2024-09-24 12:18:23.983 [info] [getSessions] [all] returned 1 session(s)
2024-09-24 12:18:25.465 [info] [removeSession] 8f676e74-eda4-4a49-a9f8-2449899c64a8.72f988bf-86f1-41af-91ab-2d7cd011db47 starting
2024-09-24 12:18:25.466 [info] [Tue, 24 Sep 2024 19:18:25 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-node@2.13.1 : Info - getTokenCache called
2024-09-24 12:18:25.466 [info] [removeSession] [8f676e74-eda4-4a49-a9f8-2449899c64a8.72f988bf-86f1-41af-91ab-2d7cd011db47] [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] removing session...
2024-09-24 12:18:25.480 [info] [Tue, 24 Sep 2024 19:18:25 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-node@2.13.1 : Info - getTokenCache called
2024-09-24 12:18:25.480 [info] [removeSession] 8f676e74-eda4-4a49-a9f8-2449899c64a8.72f988bf-86f1-41af-91ab-2d7cd011db47 attempted to remove 1 sessions
2024-09-24 12:18:25.481 [info] [getSessions] [email offline_access openid profile] starting
2024-09-24 12:18:25.481 [info] [Tue, 24 Sep 2024 19:18:25 GMT] : [a676e722-0dd2-4ab9-bc85-85527f018975] : @azure/msal-node@2.13.1 : Info - Building oauth client configuration with the following authority: https://login.microsoftonline.com/organizations/oauth2/v2.0/token.
2024-09-24 12:18:25.481 [info] [Tue, 24 Sep 2024 19:18:25 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-common@14.14.2 : Info - CacheManager:getAccessToken - No token found
2024-09-24 12:18:25.481 [info] [Tue, 24 Sep 2024 19:18:25 GMT] : [a676e722-0dd2-4ab9-bc85-85527f018975] : @azure/msal-common@14.14.2 : Info - Token refresh is required due to cache outcome: 2
2024-09-24 12:18:25.481 [info] [Tue, 24 Sep 2024 19:18:25 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-common@14.14.2 : Info - CacheManager:getRefreshToken - No refresh token found.
2024-09-24 12:18:25.482 [info] [getSessions] [email offline_access openid profile] returned 0 session(s)
2024-09-24 12:18:29.107 [info] [createSession] [email offline_access openid profile] starting
2024-09-24 12:18:29.108 [info] [Tue, 24 Sep 2024 19:18:29 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-node@2.13.1 : Info - getTokenCache called
2024-09-24 12:18:29.214 [info] [Tue, 24 Sep 2024 19:18:29 GMT] : [e4d82700-e2b3-4d06-b5b1-d4c394dfa664] : @azure/msal-node@2.13.1 : Info - getAuthCodeUrl called
2024-09-24 12:18:29.214 [info] [Tue, 24 Sep 2024 19:18:29 GMT] : [e4d82700-e2b3-4d06-b5b1-d4c394dfa664] : @azure/msal-node@2.13.1 : Info - Building oauth client configuration with the following authority: https://login.microsoftonline.com/organizations/oauth2/v2.0/token.
2024-09-24 12:18:46.203 [info] [Tue, 24 Sep 2024 19:18:46 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-node@2.13.1 : Info - acquireTokenByCode called
2024-09-24 12:18:46.203 [info] [Tue, 24 Sep 2024 19:18:46 GMT] : [e4d82700-e2b3-4d06-b5b1-d4c394dfa664] : @azure/msal-node@2.13.1 : Info - Building oauth client configuration with the following authority: https://login.microsoftonline.com/organizations/oauth2/v2.0/token.
2024-09-24 12:18:46.475 [info] [Tue, 24 Sep 2024 19:18:46 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-node@2.13.1 : Info - getTokenCache called
2024-09-24 12:18:46.476 [info] [createSession] [email offline_access openid profile] returned session
2024-09-24 12:18:46.479 [info] [Tue, 24 Sep 2024 19:18:46 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-common@14.14.2 : Info - CacheManager:getIdToken - Returning ID token
2024-09-24 12:18:46.479 [info] [getSessions] [email offline_access openid profile] starting
2024-09-24 12:18:46.479 [info] [Tue, 24 Sep 2024 19:18:46 GMT] : [eeb8fb28-4909-4306-8bf1-af249293c150] : @azure/msal-node@2.13.1 : Info - Building oauth client configuration with the following authority: https://login.microsoftonline.com/organizations/oauth2/v2.0/token.
2024-09-24 12:18:46.480 [info] [Tue, 24 Sep 2024 19:18:46 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-common@14.14.2 : Info - CacheManager:getAccessToken - Returning access token
2024-09-24 12:18:46.480 [info] [Tue, 24 Sep 2024 19:18:46 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-common@14.14.2 : Info - CacheManager:getIdToken - Returning ID token
2024-09-24 12:18:46.480 [info] [getSessions] [email offline_access openid profile] returned 1 session(s)
2024-09-24 12:18:46.480 [info] [getSessions] [email offline_access openid profile] starting
2024-09-24 12:18:46.480 [info] [Tue, 24 Sep 2024 19:18:46 GMT] : [c3478dad-d6cc-4912-b2e4-513f56b81879] : @azure/msal-node@2.13.1 : Info - Building oauth client configuration with the following authority: https://login.microsoftonline.com/organizations/oauth2/v2.0/token.
2024-09-24 12:18:46.480 [info] [Tue, 24 Sep 2024 19:18:46 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-common@14.14.2 : Info - CacheManager:getAccessToken - Returning access token
2024-09-24 12:18:46.480 [info] [Tue, 24 Sep 2024 19:18:46 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-common@14.14.2 : Info - CacheManager:getIdToken - Returning ID token
2024-09-24 12:18:46.480 [info] [getSessions] [email offline_access openid profile] returned 1 session(s)
2024-09-24 12:20:24.242 [info] [getSessions] [email offline_access openid profile] starting
2024-09-24 12:20:24.243 [info] [Tue, 24 Sep 2024 19:20:24 GMT] : [ba7f25c7-a132-454c-ba9c-ce11c3929657] : @azure/msal-node@2.13.1 : Info - Building oauth client configuration with the following authority: https://login.microsoftonline.com/organizations/oauth2/v2.0/token.
2024-09-24 12:20:24.243 [info] [Tue, 24 Sep 2024 19:20:24 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-common@14.14.2 : Info - CacheManager:getAccessToken - Returning access token
2024-09-24 12:20:24.243 [info] [Tue, 24 Sep 2024 19:20:24 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-common@14.14.2 : Info - CacheManager:getIdToken - Returning ID token
2024-09-24 12:20:24.243 [info] [getSessions] [email offline_access openid profile] returned 1 session(s)
2024-09-24 12:20:29.520 [info] [getSessions] [email offline_access openid profile] starting
2024-09-24 12:20:29.520 [info] [Tue, 24 Sep 2024 19:20:29 GMT] : [4c215472-b63c-4a15-8171-872b313bff52] : @azure/msal-node@2.13.1 : Info - Building oauth client configuration with the following authority: https://login.microsoftonline.com/organizations/oauth2/v2.0/token.
2024-09-24 12:20:29.520 [info] [Tue, 24 Sep 2024 19:20:29 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-common@14.14.2 : Info - CacheManager:getAccessToken - Returning access token
2024-09-24 12:20:29.520 [info] [Tue, 24 Sep 2024 19:20:29 GMT] : [aebc6443-996d-45c2-90f0-388ff96faa56] [https://login.microsoftonline.com/organizations] : @azure/msal-common@14.14.2 : Info - CacheManager:getIdToken - Returning ID token
2024-09-24 12:20:29.520 [info] [getSessions] [email offline_access openid profile] returned 1 session(s)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (13 by maintainers)
Omg… I think I figured this one out for real this time. In some places we use
jsonwebtoken.verifypassing in theidTokento verify audience. This also verifies expiration.Talking with MSAL folks, apparently
publicClient.acquireTokenSilent(...)will only auto-refresh access tokens if they’re near expiration. Not id tokens. So this API does return expired idTokens thinking no one will verify them. This wasn’t clear at all from the SDK or docs.The solution is to manually check the expiration of the idtoken and refresh it if it’s close.
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.
Happy Coding!