protected override bool IsAuthorized(System.Web.Http.Controllers.HttpActionContext actionContext) { bool isAuthorized = false; NewhlSecurityPrincipal currentPrincipal = CookieAuthenticationParser.ParseCookie(HttpContext.Current.Request.Cookies); isAuthorized = this.IsUserAuthorized(currentPrincipal); return(isAuthorized); }
public override void OnAuthorization(AuthorizationContext filterContext) { bool isAuthorized = false; NewhlSecurityPrincipal currentPrincipal = CookieAuthenticationParser.ParseCookie(filterContext.RequestContext.HttpContext.Request.Cookies); isAuthorized = this.IsUserAuthorized(currentPrincipal); if (isAuthorized == false) { // not allowed to proceed filterContext.Result = new RedirectResult(Constants.LoginRoute); } }
public virtual void OnAuthorization(AuthorizationContext filterContext) { CookieAuthenticationParser.ParseCookie(filterContext.RequestContext.HttpContext.Request.Cookies); }