关于[Customizing Authorization Responses in .NET 5.0]的摘要:
One feature frequently requested in the ASP.NET Core Authorization Framework was the ability to customize the HTTP response when authorization fails. Previously the only way to this was to either invoke the authorization service (IAuthorizationService) directly in your controllers (or via a filter), similar to the approach for resource-based authorization or implement your own authorization filter.
原文地址: https://benfoster.io/blog/customize-authorization-response-aspnet-core/