-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
area-authIncludes: Authn, Authz, OAuth, OIDC, BearerIncludes: Authn, Authz, OAuth, OIDC, Bearerarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcbreaking-changeThis issue / pr will introduce a breaking change, when resolved / merged.This issue / pr will introduce a breaking change, when resolved / merged.feature-minimal-hosting
Milestone
Description
Following changes to be made to the authentication and authorization configuration APIs and behaviors:
- [ ] Change the WebApplicationBuilder.Authentication
property to be a method AddAuthentication()
with the same overloads as IServiceCollection.AddAuthentication()
- [ ] Add WebApplicationBuilder.AddAuthorization()
method that is functional equivalent of IServiceCollection.AddAuthorizationBuilder()
- Remove
Authentication
property from WebApplicationBuilder - Remove binding of
AuthenticationOptions.DefaultScheme
from configuration (anddotnet user-jwts
setting it in applicationSettings.Development.json) - When there is only a single AuthN scheme added, set
AuthenticationOptions.DefaultPolicy
to that scheme, and add a newbool
propertyAuthenticationOptions.DisableAutoDefaultScheme
to enable disabling this behavior - Auto-add AuthN and AuthZ middleware if any AuthN scheme is added in
all hosts (not justWebApplicationBuilder
)WebApplicationBuilder
and add newbool
optionto the various hosting options/APIsto enable disabling this behavior, e.g.WebApplicationOptions.DisableAutoAddAuthMiddleware
This behavior should apply whether adding AuthN schemes viaIServiceCollection.AddAuthentication()
orWebApplicationBuilder.AddAuthentication()
, etc.
Metadata
Metadata
Assignees
Labels
area-authIncludes: Authn, Authz, OAuth, OIDC, BearerIncludes: Authn, Authz, OAuth, OIDC, Bearerarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcbreaking-changeThis issue / pr will introduce a breaking change, when resolved / merged.This issue / pr will introduce a breaking change, when resolved / merged.feature-minimal-hosting