我对 ASP.NET MVC 的理解是,对于授权,我应该使用类似 -
public class IPAuthorize : AuthorizeAttribute {
protected override bool AuthorizeCore(HttpContextBase httpContext) {
//figure out if the ip is authorized
//and return true or false
}
但是在 Web API 中,没有AuthorizeCore(..).
MVC的OnAuthorization(..)一般建议是不要使用OnAuthorization(..).
Web API 中的自定义授权应该使用什么?