Skip to content

Add support for MSAL Token Cache persistence with Azure authentication #1895

@cheenamalhotra

Description

@cheenamalhotra

Presently, ActiveDirectoryAuthenticationProvider implements all authentication modes but MSAL Cache location is not customizable and is in-memory by default. Cache persistence is useful for system apps that want to cache access token to file system using MSAL/Azure.Identity's cache options.

Proposed solution:

Expose API/type to enable cache persistence in OS with user options, such as:

  • Cache file name
  • Cache file location
  • Cache encryption (enabled/disabled)
  • Cache Key format
    and so on..

These options can be extended based on what underlying libraries support, and most common options can be supported. Because underlying libraries are not same for all auth modes, exposing a SqlClient specific API will ensure this support continues to be available across all authentication modes that support silent authentication.

Alternatives

The only alternative solution as of now is to implement the SqlAuthenticationProvider abstract class to be able to customize cache location and enable persistence.

I still need to solidify API design proposal but putting out this feature request to exchange thoughts :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions