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
Copy file name to clipboardExpand all lines: sdk/identity/identity/CHANGELOG.md
+3
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,9 @@
11
11
- Fixed the logic to return authority without the scheme and tenant ID [#31540](https://github.com/Azure/azure-sdk-for-js/pull/31540)
12
12
- Fixed an issue where an incorrect tenant ID was presented in multi-tenant authentication errors [#32505](https://github.com/Azure/azure-sdk-for-js/pull/32505)
13
13
-`ManagedIdentityCredential` now throws an error when attempting to pass a user-assigned Managed Identity in a ServiceFabric environment instead of silently ignoring it. [#32841](https://github.com/Azure/azure-sdk-for-js/pull/32841)
14
+
- Fixed the bug in silent authentication behavior to happen only in scenarios where an account is present either in the persistent cache (if tokenCachePersistence is enabled and authentication record is provided) or the in-memory cache, instead of silently picking up the first account found in token cache. [#32134](https://github.com/Azure/azure-sdk-for-js/pull/32134)
15
+
- Fixed the bug in interactive authentication request to account for the correct user login prompt based on the login hint provided, in case there are multiple accounts present. [#32134](https://github.com/Azure/azure-sdk-for-js/pull/32134)
16
+
- Incorporated the [fix by @azure/msal-node (v 3.2.1)](https://github.com/AzureAD/microsoft-authentication-library-for-js/pull/7469) for silent authentication to do token lookup in persistent cache.
Copy file name to clipboardExpand all lines: sdk/identity/identity/src/msal/nodeFlows/msalClient.ts
+8-22
Original file line number
Diff line number
Diff line change
@@ -418,27 +418,8 @@ export function createMsalClient(
418
418
options: GetTokenOptions={},
419
419
): Promise<msal.AuthenticationResult>{
420
420
if(state.cachedAccount===null){
421
-
state.logger.getToken.info(
422
-
"No cached account found in local state, attempting to load it from MSAL cache.",
423
-
);
424
-
constcache=app.getTokenCache();
425
-
constaccounts=awaitcache.getAllAccounts();
426
-
427
-
if(accounts===undefined||accounts.length===0){
428
-
thrownewAuthenticationRequiredError({ scopes });
429
-
}
430
-
431
-
if(accounts.length>1){
432
-
state.logger
433
-
.info(`More than one account was found authenticated for this Client ID and Tenant ID.
434
-
However, no "authenticationRecord" has been provided for this credential,
435
-
therefore we're unable to pick between these accounts.
436
-
A new login attempt will be requested, to ensure the correct account is picked.
437
-
To work with multiple accounts for the same Client ID and Tenant ID, please provide an "authenticationRecord" when initializing a credential to prevent this from happening.`);
438
-
thrownewAuthenticationRequiredError({ scopes });
439
-
}
440
-
441
-
state.cachedAccount=accounts[0];
421
+
state.logger.getToken.info("No cached account found in local state.");
422
+
thrownewAuthenticationRequiredError({ scopes });
442
423
}
443
424
444
425
// Keep track and reuse the claims we received across challenges
@@ -466,7 +447,11 @@ To work with multiple accounts for the same Client ID and Tenant ID, please prov
0 commit comments