0

我在 iis 中启用了我网站的“匿名身份验证”,我想通过HttpActionContextobj 从中间件重新识别它,

我可以从中得到这个定义HttpActionContext吗?

此代码不正确,因为它用于 AllowAnonymousAttribute:

var skipAuthorization =actionContext.ActionDescriptor.GetCustomAttributes<AllowAnonymousAttribute>().Any()
                || actionContext.ControllerContext.ControllerDescriptor.GetCustomAttributes<AllowAnonymousAttribute>().Any();
4

0 回答 0