Пример #1
0
        /// <summary>
        /// Determines a target URL (if any) for this request, based on the expected security.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="expectedSecurity"></param>
        /// <returns></returns>
        private string DetermineTargetUrl(HttpContextBase context, RequestSecurity expectedSecurity)
        {
            // Ensure the request matches the expected security.
            Logger.Log("Determining the URI for the expected security.", Logger.LogLevel.Info);
            ISecurityEvaluator securityEvaluator = SecurityEvaluatorFactory.Instance.Create(context, _settings);
            ISecurityEnforcer  securityEnforcer  = SecurityEnforcerFactory.Instance.Create(context, securityEvaluator);
            string             targetUrl         = securityEnforcer.GetUriForMatchedSecurityRequest(context.Request, context.Response, expectedSecurity, _settings);

            return(targetUrl);
        }