-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request]: Expose MSAL caching services to be used by external services #2597
Comments
|
If MSAL had support for MSI that would also solve the problem. One scenario I'm not sure is covered is the fallback authentication mechanism that Azure.Identity has when using DefaultAzureCredential. If the ManagedIdentity service is not available it will try alternate means to obtain an auth token. This is quite useful to allow developers to run a project locally. Since they don't have access to a managed identity they need to fallback to their user identity to authenticate to external resources. |
Hi @jmprieur, As @henriblMSFT says using Azure.Identity is not only for support of MSI but also for its support of fallback authentication mechanism. As developers are developing and testing locally without MSI, the DefaultAzureCredential class allows them to work without having to deal with different authentication between local and azure. Exposing the MSAL cache class so that it can be used by external libraries is one solution, another would be to add MSI support to MSAL and fallback mechanism as in Azure.Identity. |
|
@jmprieur, will Azure.Identity leverage MSAL cache for authentication mechanism (MSI, VS, Azure CLI...) or only for OBO flow? If it's only for OBO, it's a start but i think that what we would like is to have integrated caching for all mechanism 😄 |
that's more a question for the Azure SDK team, @qetza. |
MSAL is building support for Managed Identity - see a preview in 4.49.1 |
Is your feature request related to a problem? Please describe.
Azure.Identity is a library to retrieve bearer token for azure managed identities. It does not currently expose a cache as mentioned in their documentation.
To fetch token reliably consumers of the Azure.Identity need to implement the caching logic with all the complexity that comes with managing refresh tokens, temporary outages, accessing different scopes and more.
Most of this logic is already present in the Microsoft.Identity.Client library but the Cache itself cannot be used as a standalone service. It is automatically used when fetching tokens directly from Azure Active Directory. Because Azure.Identity calls a service that is hosted on the virtual machine the MSAL library cannot be used to retrieve a token for a managed
Describe the solution you'd like
Expose the Caching services so that they can be used independently of the
ConfidentialClientApplicationBuilder
Describe alternatives you've considered
Re-implementing the cache mechanism on our side which while doable is quite complex and time consuming. It is unlikely to be as robust as code that's used by thousands of other libraries.
A similar feature request has been made to the Azure.Identity library. But they mentioned that they would like to use the MSAL library caching services instead of re-building their own.
The text was updated successfully, but these errors were encountered: