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);
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
 public virtual void OnAuthorization(AuthorizationContext filterContext)
 {
     CookieAuthenticationParser.ParseCookie(filterContext.RequestContext.HttpContext.Request.Cookies);
 }