我需要为我的Hangfire仪表板创建一个AuthroizationFilter。检查是一个请求来自服务器本地到OWIN
它在Azure虚拟机上运行,并通过设计应该只接受来自本地请求的请求。
我想创建一个AuthorizationFilter,它只验证Web应用程序运行在同一虚拟机上的Web浏览器的请求。
我需要确定这种形式的OwinContext: -
public class MyRestrictiveAuthorizationFilter : IAuthorizationFilter
{
public bool Authorize(IDictionary<string, object> owinEnvironment)
{
// In case you need an OWIN context, use the next line,
// `OwinContext` class is the part of the `Microsoft.Owin` package.
var context = new OwinContext(owinEnvironment);
// Allow all local request to see the Dashboard
return true;
}
}