示例#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));
        }
示例#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));
        }
示例#3
0
        public async Task <IActionResult> Index()
        {
            var model = new DiagnosticsViewModel(await HttpContext.AuthenticateAsync());

            return(View(model));
        }