public async Task <ActionResult> Index(LoginRequest request)
        {
            ViewBag.Method = "POST";

            try
            {
                var user = _userService.Authenticate(_adContext, request.Username, request.Password);
                var data = web.Helpers.FormatHelper.ObectToJson(new { UserName = request.Username });

                if (user != null)
                {
                    AuditLogHandler.Log(user.DisplayName, data, "Login", Guid.Empty, UserHelper.GetHostedIp(HttpContext), "Login to application", "Login Successful", "Provided correct credientials", "", "");
                    _logger.Info(string.Empty);

                    return(await SetClaimsAndLogin(user));
                }
                else
                {
                    AuditLogHandler.Log(request.Username, data, "Login", Guid.Empty, UserHelper.GetHostedIp(HttpContext), "Login to application", "Login Unsuccessful", "Provided incorrect credientials", "", "");
                    _logger.Info(string.Empty);

                    ModelState.AddModelError("", "Invalid username or password.");
                    return(View("Index"));
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                return(View("Index"));
            }
        }
        public async Task <ActionResult> Logout()
        {
            var data = web.Helpers.FormatHelper.ObectToJson(new { UserName = User.FindFirst("fullName").Value });

            AuditLogHandler.Log(User.FindFirst("fullName").Value, data, "", Guid.Empty, UserHelper.GetHostedIp(HttpContext), "Logout", "Logout Successful", "", "", "");
            _logger.Info(string.Empty);

            await HttpContext.SignOutAsync();

            return(Redirect("~/Login"));
        }