Class DynamicProviderOptionsConfigurator<TOptions>
- Namespace
- Fdyay.IdentityServer.Hosting
- Assembly
- Fdyay.IdentityServer.AspNetCore.dll
Configures a handler's named options from the provider the scheme lookup found.
public sealed class DynamicProviderOptionsConfigurator<TOptions> : IConfigureNamedOptions<TOptions>, IConfigureOptions<TOptions> where TOptions : AuthenticationSchemeOptions
Type Parameters
TOptions
- Inheritance
-
DynamicProviderOptionsConfigurator<TOptions>
- Implements
-
IConfigureNamedOptions<TOptions>IConfigureOptions<TOptions>
- Inherited Members
Remarks
The named-options cache stays the framework's singleton, which means a scheme's options are built once and
this runs once per scheme rather than once per request. Both this and DynamicProviderCache are
singletons because AuthenticationMiddleware captures the scheme provider from the root provider, and a
per-request chain would fail scope validation at startup.
Until 0.68.0 the same sentence was also the recorded reason a stored row could not be edited in place, which had it backwards: building once is exactly why an edit was not seen, and the singleton cache holding those options is reachable from the singleton that resolves the scheme. The scheme lookup now drops this scheme's entry when it sees the row has changed, so the next handler built for it arrives back here and reads the new row. Nothing about the lifetimes had to change.
Constructors
DynamicProviderOptionsConfigurator(DynamicProviderCache, IEnumerable<IConfigureDynamicProvider<TOptions>>, IOptions<DynamicProviderOptions>)
Creates the configurator, as the container resolves it.
public DynamicProviderOptionsConfigurator(DynamicProviderCache cache, IEnumerable<IConfigureDynamicProvider<TOptions>> configurators, IOptions<DynamicProviderOptions> options)
Parameters
cacheDynamicProviderCacheWhere the scheme lookup left the provider row it resolved.
configuratorsIEnumerable<IConfigureDynamicProvider<TOptions>>The per-kind configurators that read the row into the options.
optionsIOptions<DynamicProviderOptions>The dynamic provider options: the sign-in scheme and the callback path prefix.
Methods
Configure(string?, TOptions)
Configures the named options of a dynamic scheme resolved on this request: a remote handler's sign-in scheme and
its callback path ({PathPrefix}/{scheme}/signin), then every IConfigureDynamicProvider<TOptions>.
Any other name is left as its host configured it.
public void Configure(string? name, TOptions options)
Parameters
namestringThe scheme name the options are for.
optionsTOptionsThe options to configure.
Configure(TOptions)
Configures the default-named options, which no dynamic scheme has, so they are left as they are.
public void Configure(TOptions options)
Parameters
optionsTOptionsThe options to configure.