Beispiel #1
0
        public ActionResult LogOut(DirectLinkOptions directLinkOptions)
        {
            var loginUrl = QPContext.LogOut();

            if (directLinkOptions != null)
            {
                loginUrl = directLinkOptions.AddToUrl(loginUrl);
            }

            return(Redirect(loginUrl));
        }
Beispiel #2
0
        public ActionResult Index(bool?useAutoLogin, DirectLinkOptions directLinkOptions, LogOnCredentials data)
        {
            data.UseAutoLogin = useAutoLogin ?? true;
            data.NtUserName   = GetCurrentUser();

            try
            {
                data.Validate();
            }
            catch (RulesException ex)
            {
                ex.Extend(ModelState);
            }

            if (ModelState.IsValid && data.User != null)
            {
                AuthenticationHelper.CompleteAuthentication(data.User);
                if (Request.IsAjaxRequest())
                {
                    return(Json(new
                    {
                        success = true,
                        isAuthenticated = true,
                        userName = data.User.Name
                    }));
                }

                var redirectUrl = QPConfiguration.WebConfigSection.BackendUrl;
                if (directLinkOptions != null)
                {
                    redirectUrl = directLinkOptions.AddToUrl(redirectUrl);
                }

                return(Redirect(redirectUrl));
            }

            InitViewBag(directLinkOptions);
            return(LogOnView(data));
        }
Beispiel #3
0
 private static string GetAuthorizationUrl(DirectLinkOptions directLinkOptions) => directLinkOptions != null?directLinkOptions.AddToUrl(AuthenticationHelper.WindowsAuthenticationUrl) : AuthenticationHelper.WindowsAuthenticationUrl;