Duende.IdentityServer.Hosting.DynamicProviders.OidcConfigureOptions is not having public
access modifier
#51
Replies: 2 comments
-
The configuration system is meant to be composable. It first runs all My recommendation would be to do a variant of your suggestion #2, implement your own class that derives from |
Beta Was this translation helpful? Give feedback.
-
IdentityServer version
7.0.8
.NET version
8
Description
I have some custom use cases where I want to extend the
OidcConfigureOptions
with some properties I define in my storage. As an example, I want to define the full url of MetadataAddress, since the provider I want to integrate doesn't expose the openid-configuration at standard path/well-known/openid-configuration
.Class definition:
class OidcConfigureOptions : ConfigureAuthenticationOptions<OpenIdConnectOptions, OidcProvider>
By having this class definition, OidcConfigureOptions is by default
internal
. Therefore I cannot inherit the class in order to extend the behavior.Current use case of extensibility:
OidcConfigureOptions
in my solution - it will work, but it's not maintainable.IPostConfigureOptions
in which I can add update the properties as I want. However this means that I need one more round trip to the storage (when no cache is implemented), or I have to manually resolve theDynamicAuthentncationSchemeCache
.Trade-off:
IPostConfigureOptions
will run also for OpenIdConnect providers which are configured from app settings (the standard way with AddOpenIdConnect()`. This means that additional execution will be done for no reason.Trade-off2: By default, the configuration of
Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectPostConfigureOptions
is performed when I doAddIdentityServer()
. This PostConfigureOptions is in charge of configuring the MetadataAddress as part of the options. If I am to create my CustomPostConfigureOptions, I will need to register it beforeAddIdentityServer()
which is not something I would expect to do.3. Decorator implementation of
OidcConfigureOptions
.Trade-off: For this approach, I will have to duplicate some logic from
Duende.IdentityServer.Hosting.DynamicProviders.ConfigureAuthenticationOptions<,>
and this logic will be executed 2 times.Reproduction steps
No response
Expected behavior
From my point of view, the class
Duende.IdentityServer.Hosting.DynamicProviders.OidcConfigureOptions
should bepublic
, as it will provide better extensibility for the current design.Is there any reason why this class is not having
public
access modifier?Logs
No response
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions