pnpcore icon indicating copy to clipboard operation
pnpcore copied to clipboard

OnBehalfOfTokenProvider does not cache token - requires UseSharedCache

Open hazzinator1 opened this issue 5 months ago • 0 comments

Category

  • [x] Feature request

Describe the feature

There is no way of adding:

.WithCacheOptions(new CacheOptions()
{
  UseSharedCache = true
})

to the ConfidentialClientApplication inside of OnBehalfOfAuthenticationProvider. The way our .NET Core API works is that we end up creating a new OnBehalfOfAuthenticationProvider per request, so without this extension the token swap will not cache and has to be repeated with every request.

Describe the solution you'd like

Basically just providing some way of providing this boolean into the constructor arguments of OnBehalfOfAuthenticationProvider as a very basic solution. I'm open to other suggestions.

hazzinator1 avatar Feb 05 '24 08:02 hazzinator1