IdentityServer icon indicating copy to clipboard operation
IdentityServer copied to clipboard

Consider different approach for optional services from DI

Open brockallen opened this issue 1 year ago • 2 comments

In a few places we use optional injected services and check for null to adjust behavior. This is a valid approach when using the MS DI system, but we've seen a few requests from customers that use other DI systems and those often don't allow injecting optional/null dependencies. Perhaps we can review our approach and improve it.

brockallen avatar Feb 15 '24 15:02 brockallen

These are the services that we will need to think about when implementing this. They're the services I found that are resolved with null as a default value in constructors.

  • IAuthorizationParametersMessageStore
  • IServerSideSessionStore
  • ISessionManagementService
  • IOperationalStoreNotification
  • IEnumerable<IdentityResource>
  • IEnumerable<ApiResource>
  • IEnumerable<ApiScope>
  • IdentityServerLicense
  • IDataProtectionProvider
  • IServerSideTicketStore
  • IdentityServerOptions

josephdecock avatar Feb 18 '24 20:02 josephdecock