Consider ability to control IDistributedCache
instance used
#50
Labels
area/access-token-management
Issues related to Access Token Management
priority/3
Medium
state/needs-triage
Needs triaging by the maintainers
Which version of Duende.AccessTokenManagement are you using?
v3.0.0.
Which version of .NET are you using?
.NET 8.
Describe the
bugfeature requestWe'd like to open a conversation with regards to how Duende.AccessTokenManagement resolves the
IDistributedCache
implementation it uses under the hood.We come from a scenario where we didn't use to cache app-related data, so we registered the in-memory distributed cache implementation, which the library happily used.
Later, we decided we needed an out-of-process cache to store some commonly-used data across multiple instances.
We swapped out the in-memory distributed cache implementation by the StackExchange.Redis one.
It works, but it means that each instance needs to get the token from Redis for every HTTP request going to the protected service.
It's not that bad, really, but we don't really care whether the different instances use the same access tokens, and if we had the choice we'd rather store them in memory.
We're not interested in per-client selection of
IDistributedCache
, I'll let you decide if it's a scenario you'd like to take into account.Some ideas up for discussion if you agree the conversation should go forward, both of which rely on adding "service-level" options for the client credentials token management:
Func<IServiceProvider, IDistributedCache>? DistributedCacheFactory
delegate that consumers can use to determine how to resolve theIDistributedCache
implementation they want to use.string? DistributedCacheKey
that, if specified, would be used to resolve the desired implementation.To Reproduce
N/A.
Expected behavior
N/A.
Log output/exception with stacktrace
N/A
Additional context
I don't think there's any apart from the feature request description. Let me know otherwise.
The text was updated successfully, but these errors were encountered: