public override void OnActionExecuted(ActionExecutedContext filterContext) { var isArmed = Convert.ToBoolean(ConfigurationManager.AppSettings["IsArmed"]); if (!isArmed) return; var armorFortify = new ArmorFortify(new MvcIdentityReaderFactory(filterContext.HttpContext.User), filterContext.HttpContext.ApplicationInstance.Context); var isFortified = armorFortify.TryFortify(); if (isFortified) base.OnActionExecuted(filterContext); else filterContext.Result = new HttpUnauthorizedResult(); }
public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) { var isArmed = Convert.ToBoolean(ConfigurationManager.AppSettings["IsArmed"]); if (!isArmed) return; var armorFortify = new ArmorFortify(new WebApiIdentityReaderFactory(Thread.CurrentPrincipal), HttpContext.Current); var isFortified = armorFortify.TryFortify(); if (isFortified) base.OnActionExecuted(actionExecutedContext); else throw new HttpResponseException(HttpStatusCode.Unauthorized); }
public override void OnActionExecuted( ActionExecutedContext filterContext) { if (!ArmorSettings.IsArmed) return; var armorFortify = new ArmorFortify( new MvcIdentityReaderFactory(filterContext.HttpContext.User), filterContext.HttpContext.ApplicationInstance.Context); var isFortified = armorFortify.TryFortify(); if (isFortified) base.OnActionExecuted(filterContext); else filterContext.Result = new HttpUnauthorizedResult(); }
public override void OnActionExecuted( HttpActionExecutedContext actionExecutedContext) { if (!ArmorSettings.IsArmed) return; var armorFortify = new ArmorFortify( new WebApiIdentityReaderFactory(Thread.CurrentPrincipal), HttpContext.Current); var isFortified = armorFortify.TryFortify(); if (isFortified) base.OnActionExecuted(actionExecutedContext); else throw new HttpResponseException(HttpStatusCode.Unauthorized); }
public override void OnActionExecuted( HttpActionExecutedContext actionExecutedContext) { if (!ArmorSettings.IsArmed) { return; } var armorFortify = new ArmorFortify( new WebApiIdentityReaderFactory(Thread.CurrentPrincipal), HttpContext.Current); var isFortified = armorFortify.TryFortify(); if (isFortified) { base.OnActionExecuted(actionExecutedContext); } else { throw new HttpResponseException(HttpStatusCode.Unauthorized); } }
public override void OnActionExecuted( ActionExecutedContext filterContext) { if (!ArmorSettings.IsArmed) { return; } var armorFortify = new ArmorFortify( new MvcIdentityReaderFactory(filterContext.HttpContext.User), filterContext.HttpContext.ApplicationInstance.Context); var isFortified = armorFortify.TryFortify(); if (isFortified) { base.OnActionExecuted(filterContext); } else { filterContext.Result = new HttpUnauthorizedResult(); } }