Пример #1
0
        public IActionResult Index()
        {
            ViewBag.isStrong = _ffdcClientService.GetIsStrongValue();
            string authCodeurl = _ffdcClientService.GetFFDCAuthCodeUri();

            return(Redirect(authCodeurl));
        }
Пример #2
0
        public IActionResult Index()
        {
            var isStrong = _ffdcClientService.GetIsStrongValue();

            ViewBag.isStrong = isStrong;
            string token = _ffdcClientService.GenerateToken(isStrong);

            if (!string.IsNullOrEmpty(token))
            {
                HttpContext.Session.SetString("token", token);
                return(View("auth", token));
            }

            return(View("error", "Unauthorized!"));
        }
Пример #3
0
        public IActionResult Index()
        {
            ViewBag.isStrong = _ffdcClientService.GetIsStrongValue();
            string token        = HttpContext.Session.GetString("token");
            int    responseCode = 200;

            if (string.IsNullOrEmpty(token))
            {
                return(View("~/Views/Login/error.cshtml", "Unauthorized!"));
            }
            var result = _ffdcClientService.GetResults(token, out responseCode);

            if (responseCode == 200)
            {
                return(View("results", result));
            }
            else
            {
                return(View("~/Views/Login/error.cshtml", "Unauthorized!"));
            }
        }
Пример #4
0
 public IActionResult Index()
 {
     ViewBag.isStrong = _ffdcClientService.GetIsStrongValue();
     return(View());
 }