我在 iis 中启用了我网站的“匿名身份验证”,我想通过HttpActionContext
obj 从中间件重新识别它,
我可以从中得到这个定义HttpActionContext
吗?
此代码不正确,因为它用于 AllowAnonymousAttribute:
var skipAuthorization =actionContext.ActionDescriptor.GetCustomAttributes<AllowAnonymousAttribute>().Any()
|| actionContext.ControllerContext.ControllerDescriptor.GetCustomAttributes<AllowAnonymousAttribute>().Any();