c# – SharePoint中的FBA登录页面问题
发布时间:2020-12-15 21:31:26 所属栏目:百科 来源:网络整理
导读:我有自定义登录代码的FBA sharepoint站点(见下文).当用户登出侧系统并将Cookie值传递给FormsAuthentication.RedirectFromLoginPage(userName,false);时.它工作正常,直到这里. 问题是,如果用户离开系统并注销并使用不同的用户ID登录并进入我的SharePoint站点,
我有自定义登录代码的FBA sharepoint站点(见下文).当用户登出侧系统并将Cookie值传递给FormsAuthentication.RedirectFromLoginPage(userName,false);时.它工作正常,直到这里.
问题是,如果用户离开系统并注销并使用不同的用户ID登录并进入我的SharePoint站点,则会跳过登录过程并且用户使用旧ID(不具有新的登录ID)登录. 如果用户键入sharepoint站点URL并重定向到shareoint站点,我们是否可以通过登录过程. 请大师帮助我. try { if (Request.Cookies[authCookie].Value.Length > 0 || Request.Cookies[authCookie].Value != null || Request.Cookies[authCookie].Value != "") { userName = Request.Cookies[authCookie].Value; } } catch (Exception ex) { Response.Redirect("https://qa.company.com/appssecured/login/servlet/LoginServlet?TARGET_URL=" + Request.Url); } if (true) { userName = Request.Cookies[authCookie].Value; FormsAuthentication.RedirectFromLoginPage(userName,false); } Web.Config中 <authentication mode="Forms"> <forms loginUrl="LoginAuth.aspx" timeout="2880" enableCrossAppRedirects="false" /> <!-- <forms loginUrl="/_layouts/login.aspx" />--> </authentication> 解决方法
为什么不用
FormsAuthentication.SignOut(); FormsAuthentication.RedirectToLoginPage(); 这应该正确清除cookie并重定向到登录页面. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |