dotnet / dotnet/aspnetcore

IAuthorizationMiddlewareResultHandler not called

Open
#50,867 3 comments 0 reactions 0 assignees View on GitHub
area-auth enhancement
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

A custom IAuthorizationMiddlewareResultHandler is not called if a controller/action is not decorated with Authorize-Attribute but instead enriched via a IControllerModelConvention, e.g.
`
controller.Filters.Add(new AuthorizeFilter(AuthConstants.PolicyMembershipFull));
`

### Expected Behavior

The IAuthorizationMiddlewareResultHandler.HandleAsync needs to get called not matter how the controller/action gets it's Authorization settings.

### Steps To Reproduce

see description

### Exceptions (if any)

_No response_

### .NET Version

.net 7

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.