Use tenant id for building the cache key. Right now the cache key used is using tenant as common, but should be managed-identity #710
Labels
Enhancement
A request or suggestion to improve some aspect of the library
The cache key for managed identity should be same for MSAL.Net and MSAL Java.
Currently, the difference between the cache key is the tenant.
Cache key in MSAL.Net: -login.microsoftonline.com-accesstoken-system_assigned_managed_identity-managed_identity-https://management.azure.com
Cache key in MSAL Java: -login.microsoftonline.com-accesstoken-system_assigned_managed_identity-common-https://management.azure.com
The format of the cache key: --accesstoken---
Since the authority is not used in case of managed identity, the default authority is used for managed identity. But also after adding
managed-identity
as tenant the common tenant id is used for cache key.MSAL.Net follows this algorithm to get the tenant.
We can either implement this algorithm or modify the default authority for managed identity.
Preference to have consistency with MSAL.Net and have the same logic to use the tenant id unless there is a concern.
The text was updated successfully, but these errors were encountered: