【发布时间】:2014-03-06 20:21:50
【问题描述】:
使用单点登录在 .Net 中安装应用程序。我们已经实施了 CAS。单点登录有效,但单点注销无效。
在 web.config 中 CAS 的配置如下:
<section name="casClientConfig" type="DotNetCasClient.Configuration.CasClientConfiguration, DotNetCasClient"/>
<casClientConfig
casServerLoginUrl="http://aus-vc-bdpu-tl1.argous.com:8100/cas/login"
casServerUrlPrefix=" http://au-vc-bdpu-tl1.argous.com:8100/cas"
serverName="http://localhost:53124/"
cookiesRequiredUrl="~/CookiesRequired.aspx"
redirectAfterValidation="true" gateway="false" renew="false" singleSignOut="true"
ticketTimeTolerance="50000000"
ticketValidatorName="Saml11" proxyTicketManager="CacheProxyTicketManager"
serviceTicketManager="CacheServiceTicketManager"
gatewayStatusCookieName="CasGatewayStatus"/>
我添加了以下代码来清除注销功能的 cookie:
ClearAuthCookie();
string redirectPage = System.Configuration.ConfigurationSettings.AppSettings["CASurl"];
Response.Redirect(redirectPage, true);
public static void ClearAuthCookie()
{
HttpContext current = HttpContext.Current;
HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName);
cookie.Expires = DateTime.Now.AddMonths(-1);
cookie.Domain = FormsAuthentication.CookieDomain;
cookie.Path = FormsAuthentication.FormsCookiePath;
current.Response.Cookies.Add(cookie);
}
我有两个问题:
(1) 注销时页面被重定向到所需页面,但如果我通过后退按钮返回应用程序主页并单击各种链接,页面将导航到链接而不是要求用户登录。因此注销不成功。
(2) 当用户在使用单点登录的另一个应用程序时,如果他从另一个应用程序注销,用户仍然可以访问我们的网站的父应用程序。因此单点注销不起作用
请您建议我在这里缺少什么以使其起作用。
【问题讨论】: