public void OnActionExecuted(ActionExecutedContext filterContext)
        {
            if (!_casServices.Settings.IsConfigured())
            {
                Logger.Debug("CAS is not configured correctly");
                return;
            }

            var workContext = filterContext.RequestContext.GetWorkContext();
            var httpContext = workContext.HttpContext;

            if (!_requestEvaluator.GetRequestIsAppropriateForCasAuthentication(httpContext) || filterContext.Result is JsonResult)
            {
                Logger.Debug("No EndRequest processing for {0}", httpContext.Request.RawUrl);
                return;
            }

            Logger.Debug("Starting EndRequest for {0}", httpContext.Request.RawUrl);

            ActionResult redirectRequest = _casActionFilter.OnActionExecuted(workContext);

            if (redirectRequest != null)
            {
                filterContext.Result = redirectRequest;
            }

            Logger.Debug("Ending EndRequest for {0}", httpContext.Request.RawUrl);
        }
        private void ProcessAuthorization(HttpContextBase httpContext)
        {
            if (!_requestEvaluator.GetRequestIsAppropriateForCasAuthentication(httpContext))
            {
                Logger.Debug("No EndRequest processing for {0}", httpContext.Request.RawUrl);
                return;
            }

            if (_requestEvaluator.GetRequestHasCasTicket(httpContext))
            {
                Logger.Information("Processing Proxy Callback request");
                _casClient.ProcessTicketValidation(httpContext);
            }

            Logger.Debug("Starting AuthenticateRequest for {0}", httpContext.Request.RawUrl);
            _casClient.ProcessRequestAuthentication(httpContext);
            Logger.Debug("Ending AuthenticateRequest for {0}", httpContext.Request.RawUrl);
        }
Example #3
0
        public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
        {
            if (!_casServices.Settings.IsConfigured())
            {
                Logger.Debug("CAS is not configured correctly");
                return;
            }

            var workContext = actionExecutedContext.ActionContext.ControllerContext.GetWorkContext();
            var httpContext = workContext.HttpContext;

            if (!_requestEvaluator.GetRequestIsAppropriateForCasAuthentication(httpContext))
            {
                Logger.Debug("No EndRequest processing for {0}", httpContext.Request.RawUrl);
                return;
            }

            Logger.Debug("Starting EndRequest for {0}", httpContext.Request.RawUrl);

            _casActionFilter.OnActionExecuted(workContext);

            Logger.Debug("Ending EndRequest for {0}", httpContext.Request.RawUrl);
        }