IdentityModel / IdentityModel.AspNetCore.OAuth2Introspection

ASP.NET Core authentication handler for OAuth 2.0 token introspection
Apache License 2.0
147 stars 66 forks source link

Use MemoryDistributedCache only for PostConfigureOAuth2IntrospectionOptions IoC #172

Open aramirezh-dev opened 1 year ago

aramirezh-dev commented 1 year ago

Question: Is it possible to change the IoC for IDistributedCache to use MemoryDistributedCache only for PostConfigureOAuth2IntrospectionOptions? I have a lot of issues with redis connection

renagaev commented 1 year ago

@leastprivilege Hi, I'm looking to add the ability to choose an IDistributedCache implementation, like using in-memory for introspection and redis for the other app. I don't want to store plain user data in redis for security reasons.

I can pass in my cache implementation to the OAuth2IntrospectionHandler by registering it via Func<IServiceProvider, OAuth2IntrospectionHandler> which call contructor directly. Unfortunately, this trick doesn't work for the PostConfigureOAuth2IntrospectionOptions, as it's an internal class.

I can create PR if you help me pick right approach for implementing this.

renagaev commented 1 year ago

@leastprivilege @brockallen up

kooshan commented 7 months ago

I have similar problem. Would you please address this? @leastprivilege @brockallen