Exemplo n.º 1
0
        public void Init(HttpApplication context)
        {
            context.AuthenticateRequest += (sender, args) =>
            {
                var httpContext = HttpContext.Current;

                if (httpContext.User != null && httpContext.User.Identity.IsAuthenticated)
                {
                    var user = _loggedUserService.GetLoggedUser();

                    if (user != null)
                    {
                        httpContext.User = new LtaPrincipal(user);
                    }
                }
            };
        }
        public IActionResult Get()
        {
            var user = _loggedUserService.GetLoggedUser <MyLoggedUser>();

            return(Ok(user));
        }