Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
1.99k stars 1.16k forks source link

@azure/identity-cache-persistence overwrites Microsoft.Developer.IdentityService entry in the keychain across different applications. #29824

Open altinokdarici opened 1 month ago

altinokdarici commented 1 month ago

Describe the bug @azure/identity-cache-persistence overwrites Microsoft.Developer.IdentityService entry in the keychain across applications.

To Reproduce Scenario: There are two different applications using @azure/identity-cache-persistence. Application A has the following configuration;

export const tokenCachePersistenceOptions: TokenCachePersistenceOptions = { enabled: true, name: 'appA', };

Application B has the following config:

export const tokenCachePersistenceOptions: TokenCachePersistenceOptions = { enabled: true, name: 'appB', };

User runs the app A, authentication happens and the token gets stored in the KeyChain with the entry name: Microsoft.Developer.IdentityService

User runs the app B, @azure/identity-cache-persistence reads the KeyChain with the entry name: Microsoft.Developer.IdentityService and authentication fail (or interactive auth happens again) because this entry stored by app A.

Expected behavior Each application should have its own entry in the KeyChain regarding the configuration. ie: Microsoft.Developer.IdentityService-appA and Microsoft.Developer.IdentityService-appB

github-actions[bot] commented 1 month ago

@KarishmaGhiya @maorleger

github-actions[bot] commented 1 month ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.