Exemplo n.º 1
0
        public void OnAuthorization(AuthorizationFilterContext context)
        {
            //
            StringValues tokens = new StringValues();

            if (context.HttpContext.Request.Headers.TryGetValue("session-token", out tokens))
            {
                var token = tokens.FirstOrDefault();
                if (tokenx.AuthenticationToken(token))
                {
                    RedirectToActionResult content = new RedirectToActionResult("NoAuth", "Exception", null);
                    context.Result = content;
                }
            }
        }