AppMetrics.WebUtils.BasicAuthenticationModule.AuthenticateRequest C# (CSharp) Method

AuthenticateRequest() static private method

static private AuthenticateRequest ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        static void AuthenticateRequest(object sender, EventArgs e)
        {
            try
            {
                var application = (HttpApplication)sender;
                var context = application.Context;
                if (!Authenticate(context))
                {
                    var response = context.Response;
                    response.Status = "401 Unauthorized";
                    response.StatusCode = 401;
                    response.AddHeader("WWW-Authenticate", "Basic");
                }
            }
            catch (Exception exc)
            {
                WebLogger.Report(exc.ToString());
            }
        }