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(..)
。
ありOnAuthorization(..)
、MVCの一般的なアドバイスは使用しないことOnAuthorization(..)
です。
Web APIのカスタム認証には何を使用する必要がありますか?