public override async Task Invoke(IOwinContext context)
        {
            IRequest          owinRequest      = new OwinRequest(context.Request.Query, await context.Request.ReadFormAsync());
            IResponseRenderer responseRenderer = new OwinResponseRenderer(context);

            _runningApplication.Handle(owinRequest, responseRenderer);
        }
        public async Task Invoke(HttpContext httpContext)
        {
            IRequest          request          = new AspNetCoreRequest(httpContext.Request.Query, httpContext.Request.HasFormContentType ? httpContext.Request.Form : null);
            IResponseRenderer responseRenderer = new AspNetCoreResponseRenderer(httpContext);

            _runningApplication.Handle(request, responseRenderer);
        }
        public override async Task Invoke(IOwinContext context)
        {
            IRequest          owinRequest      = new OwinRequest(context.Request.Query, await context.Request.ReadFormAsync());
            IResponseRenderer responseRenderer = new OwinResponseRenderer(context);

            if (options.EnableAuthentication)
            {
                if (context.Authentication.User.Identity.IsAuthenticated)
                {
                    _runningApplication.Handle(owinRequest, responseRenderer);
                }
                else
                {
                    await context.Response.WriteAsync("You can't access CrystalQuartz.");
                }
            }
            else
            {
                _runningApplication.Handle(owinRequest, responseRenderer);
            }
        }
Exemplo n.º 4
0
        public override async Task Invoke(IOwinContext context)
        {
            IRequest          owinRequest      = new OwinRequest(context.Request.Query, await context.Request.ReadFormAsync());
            IResponseRenderer responseRenderer = new OwinResponseRenderer(context);

            if (_options.UseAuthentication && (context.Authentication.User == null || context.Authentication.User.Identities == null || !context.Authentication.User.Identity.IsAuthenticated))
            {
                responseRenderer.Render(new NotAuthorizedResponse());
            }
            else
            {
                _runningApplication.Handle(owinRequest, responseRenderer);
            }
        }
Exemplo n.º 5
0
 public void ProcessRequest(HttpContext context)
 {
     RunningApplication.Handle(
         new SystemWebRequest(context),
         new SystemWebResponseRenderer(context));
 }