Exemplo n.º 1
0
        public async Task <IActionResult> Index()
        {
            var localAddresses = new string[] { "127.0.0.1", "::1", HttpContext.Connection.LocalIpAddress.ToString() };

            if (!localAddresses.Contains(HttpContext.Connection.RemoteIpAddress.ToString()))
            {
                return(NotFound());
            }

            var model = new DiagnosticsViewModel(await HttpContext.AuthenticateAsync());

            return(View(model));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Index()
        {
            var localAddresses = new string[] { "127.0.0.1", "::1", HttpContext.Connection.LocalIpAddress.ToString() };

            if (!localAddresses.Contains(HttpContext.Connection.RemoteIpAddress.ToString()))
            {
                return(NotFound());
            }


            var model = new DiagnosticsViewModel(await HttpContext.AuthenticateAsync());

            // model.AuthenticateResult.Principal.Claims.add(new Claim(ClaimTypes.Role, "administrator"));

            return(View(model));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Index()
        {
            var model = new DiagnosticsViewModel(await HttpContext.AuthenticateAsync());

            return(View(model));
        }