protected override bool IsAuthorized(HttpActionContext actionContext) {
            var isArmed = Convert.ToBoolean(ConfigurationManager.AppSettings["IsArmed"]);
            if (!isArmed) return true;

            var armorAuthorize = new ArmorAuthorize(new WebApiHttpRequestArmorHeaderParserFactory(actionContext.Request.Headers), new WebApiIdentityReaderFactory(Thread.CurrentPrincipal));
            return armorAuthorize.Authorize();
        }
        protected override bool IsAuthorized(HttpActionContext actionContext) {
            if (!ArmorSettings.IsArmed) return true;

            var armorAuthorize =
                new ArmorAuthorize(
                    new WebApiHttpRequestArmorHeaderParserFactory(
                        actionContext.Request.Headers),
                    new WebApiIdentityReaderFactory(Thread.CurrentPrincipal));
            return armorAuthorize.Authorize();
        }
コード例 #3
0
        protected override bool IsAuthorized(HttpActionContext actionContext)
        {
            if (!ArmorSettings.IsArmed)
            {
                return(true);
            }

            var armorAuthorize =
                new ArmorAuthorize(
                    new WebApiHttpRequestArmorHeaderParserFactory(
                        actionContext.Request.Headers),
                    new WebApiIdentityReaderFactory(Thread.CurrentPrincipal));

            return(armorAuthorize.Authorize());
        }
コード例 #4
0
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            if (!ArmorSettings.IsArmed)
            {
                return(true);
            }

            var armorAuthorize =
                new ArmorAuthorize(
                    new MvcHttpRequestArmorHeaderParserFactory(
                        httpContext.Request.Headers),
                    new MvcIdentityReaderFactory(Thread.CurrentPrincipal));

            return(armorAuthorize.Authorize());
        }