Skip to content

Feature request: Make RouteData or HttpContext available on AuthorizationHandlerContext #16695

Closed
@mjrousos

Description

@mjrousos

Is your feature request related to a problem? Please describe.

Prior to endpoint routing, AuthorizationHandlerContext's resource property was of type AuthorizationFilterContext from which it was possible to RouteData, HttpContext, etc.

Now, with EndpointRouting, AuthorizationHandlerContext.Resource is of type RouteEndpoint which describes the endpoint the call is going to, but doesn't include route data.

It's not too hard to work around this with IHttpContextAccessor.HttpContext.GetRouteData() but, given that it seems like a common scenario for auth handlers to access route data, it would be convenient to not have to inject an extra property into the handler to get that data.

Describe the solution you'd like

Expose RouteData or HttpContext directly from AuthorizationHandlerContext

Metadata

Metadata

Assignees

Labels

area-authIncludes: Authn, Authz, OAuth, OIDC, Bearerbreaking-changeThis issue / pr will introduce a breaking change, when resolved / merged.enhancementThis issue represents an ask for new feature or an enhancement to an existing one

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions