Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Microsoft.​Extensions.​DependencyInjection.​IdentityServerBuilderExtensionsCore
Assembly: Duende.IdentityServer
Inheritance: object → IdentityServerBuilderExtensionsCore
Builder extension methods for registering core services
Methods
public static
IIdentityServerBuilder
AddRequiredPlatformServices​(IIdentityServerBuilder builder)
Registers the fundamental ASP.NET Core platform services required by IdentityServer,
including <see cref="T:Microsoft.AspNetCore.Http.IHttpContextAccessor" /> , the options infrastructure, and a named
<see cref="T:System.Net.Http.HttpClient" /> factory. Also registers <see cref="T:Duende.IdentityServer.Configuration.IdentityServerOptions" /> and
<c>PersistentGrantOptions</c> as resolvable singletons from the options system.
Returns The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> for chaining.
builder
The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> to add platform services to.
public static
IIdentityServerBuilder
AddCookieAuthentication​(IIdentityServerBuilder builder)
Adds the default infrastructure for cookie authentication in IdentityServer.
Registers the default and external cookie authentication schemes and the necessary
decorators and post-configuration hooks required for IdentityServer's session management.
Returns The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> for chaining.
builder
The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> to add cookie authentication to.
public static
IIdentityServerBuilder
AddDefaultCookieHandlers​(IIdentityServerBuilder builder)
Adds the default cookie handlers and corresponding configuration.
Registers the IdentityServer default cookie scheme and the external cookie scheme used
for temporarily holding external identity provider claims during sign-in.
Returns The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> for chaining.
builder
The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> to add cookie handlers to.
public static
IIdentityServerBuilder
AddCookieAuthenticationExtensions​(IIdentityServerBuilder builder)
Adds the necessary decorators for cookie authentication required by IdentityServer.
Registers post-configuration for cookie options, and decorates <see cref="T:Microsoft.AspNetCore.Authentication.IAuthenticationService" />
and <see cref="T:Microsoft.AspNetCore.Authentication.IAuthenticationHandlerProvider" /> to support federated sign-out.
Returns The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> for chaining.
builder
The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> to add cookie authentication extensions to.
public static
IIdentityServerBuilder
AddDefaultEndpoints​(IIdentityServerBuilder builder)
Registers all default IdentityServer protocol endpoints and their corresponding HTTP response writers.
Endpoints include: authorize, token, discovery, userinfo, end-session, introspection, revocation,
device authorization, backchannel authentication, pushed authorization, check-session, and JWKS.
Returns The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> for chaining.
builder
The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> to add endpoints to.
public static
IIdentityServerBuilder
AddEndpoint​(IIdentityServerBuilder builder,
string name,
AspNetCore.​Http.​PathString path,
System.​Func?<​AspNetCore.​Http.​HttpContext, bool> isMatch = null)
Registers a custom protocol endpoint handler and maps it to the specified path.
The endpoint is registered as a transient service and added to the endpoint routing table.
builder
The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> to add the endpoint to.
name
The logical name of the endpoint (e.g. <c>EndpointNames.Authorize</c> ).
path
The URL path at which the endpoint is served.
isMatch
An optional custom matching function for the endpoint. Defaults to <see langword="null" /> ,
which uses the default path-based matching algorithm.
public static
IIdentityServerBuilder
AddHttpWriter​(IIdentityServerBuilder builder)
Registers a custom <see cref="T:Duende.IdentityServer.Hosting.IHttpResponseWriter`1" /> for a specific <see cref="T:Duende.IdentityServer.Hosting.IEndpointResult" /> type,
allowing customization of how a particular endpoint result is serialized to the HTTP response.
public static
IIdentityServerBuilder
AddCoreServices​(IIdentityServerBuilder builder)
Registers the core IdentityServer services that are not protocol-endpoint-specific.
This includes server URL helpers, issuer name resolution, secret parsing and validation pipelines,
extension grant validation, JWT request validation, user session management, CORS infrastructure,
SAML no-op stubs, concurrency locks, empty default stores, licensing, and diagnostic services.
builder
The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> to add core services to.
public static
IIdentityServerBuilder
AddPluggableServices​(IIdentityServerBuilder builder)
Registers the default implementations of all pluggable IdentityServer services.
This includes token creation and validation, claims generation, refresh token handling,
consent management, CORS policy, profile service, event sink, device flow, backchannel
authentication throttling, pushed authorization, session coordination, and HTTP clients
for back-channel logout and JWT request URI fetching.
All registrations use <c>TryAdd</c> so they can be replaced by custom implementations.
Returns The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> for chaining.
builder
The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> to add pluggable services to.
public static
IIdentityServerBuilder
AddKeyManagement​(IIdentityServerBuilder builder)
Registers the automatic key management services used by IdentityServer to create, rotate,
and retire signing keys without manual intervention. Includes the key manager, key store
(defaulting to the file system), key protector (using ASP.NET Core Data Protection),
and an in-memory key store cache.
Returns The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> for chaining.
builder
The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> to add key management services to.
public static
IIdentityServerBuilder
AddDynamicProvidersCore​(IIdentityServerBuilder builder)
Registers the core infrastructure for the dynamic external identity providers feature.
This includes a dynamic <see cref="T:Microsoft.AspNetCore.Authentication.IAuthenticationSchemeProvider" /> decorator that loads
provider schemes on demand, a no-op <see cref="T:Duende.IdentityServer.Stores.IIdentityProviderStore" /> default, and
per-request and singleton caches for dynamically loaded authentication schemes.
Returns The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> for chaining.
builder
The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> to add dynamic provider core services to.
public static
IIdentityServerBuilder
AddValidators​(IIdentityServerBuilder builder)
Registers the default implementations of all request validators used by IdentityServer's protocol endpoints.
Includes validators for authorization, token, end-session, introspection, revocation, device authorization,
backchannel authentication, pushed authorization, resource owner password, redirect URIs, DPoP proofs,
and client/identity provider configuration. All registrations use <c>TryAdd</c> so they can be replaced.
Returns The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> for chaining.
builder
The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> to add validators to.
public static
IIdentityServerBuilder
AddResponseGenerators​(IIdentityServerBuilder builder)
Registers the default response generators for all IdentityServer protocol endpoints.
Includes generators for token, userinfo, introspection, authorize, discovery, revocation,
device authorization, backchannel authentication, and pushed authorization responses.
All registrations use <c>TryAdd</c> so they can be replaced by custom implementations.
Returns The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> for chaining.
builder
The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> to add response generators to.
public static
IIdentityServerBuilder
AddDefaultSecretParsers​(IIdentityServerBuilder builder)
Registers the default secret parsers for extracting client credentials from incoming requests.
Adds <c>BasicAuthenticationSecretParser</c> (HTTP Basic authentication header) and
<c>PostBodySecretParser</c> (form-encoded request body) as the default parsers.
Returns The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> for chaining.
builder
The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> to add secret parsers to.
public static
IIdentityServerBuilder
AddDefaultSecretValidators​(IIdentityServerBuilder builder)
Registers the default secret validator for verifying client credentials.
Adds <c>HashedSharedSecretValidator</c> , which validates shared secrets stored as SHA-256 or SHA-512 hashes.
Returns The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> for chaining.
builder
The <see cref="T:Microsoft.Extensions.DependencyInjection.IIdentityServerBuilder" /> to add secret validators to.
public static
IIdentityServerBuilder
AddLicenseSummary​(IIdentityServerBuilder builder)
Adds the license summary, which provides information about the current license usage.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object