CAS Logout 通知全部登陆客户端销毁Session


具体通知由org.jasig.cas.authentication.principal.AbstractWebApplicationService发出。logOutOfService方法生成发送消息,而后由org.jasig.cas.util.HttpClient的sendMessageToEndPoint方法发出。
public boolean sendMessageToEndPoint(final String url, final String message) {
HttpURLConnection connection = null;
BufferedReader in = null;
try {
if (log.isDebugEnabled()) {
log.debug("Attempting to access " + url);
}
final URL logoutUrl = new URL(url);
final String output = "logoutRequest=" + URLEncoder.encode(message, "UTF-8");html

connection = (HttpURLConnection) logoutUrl.openConnection();
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setReadTimeout(this.readTimeout);
connection.setConnectTimeout(this.connectionTimeout);
connection.setRequestProperty("Content-Length", ""
+ Integer.toString(output.getBytes().length));
connection.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
final DataOutputStream printout = new DataOutputStream(connection
.getOutputStream());
printout.writeBytes(output);
printout.flush();
printout.close();web

in = new BufferedReader(new InputStreamReader(connection
.getInputStream()));数据库

while (in.readLine() != null) {
// nothing to do
}

if (log.isDebugEnabled()) {
log.debug("Finished sending message to" + url);
}
return true;
} catch (final Exception e) {
log.error(e,e);
return false;
} finally {
if (in != null) {
try {
in.close();
} catch (final IOException e) {
// can't do anything
}
}
if (connection != null) {
connection.disconnect();
}
}
}浏览器

 

 

http://blog.csdn.net/redstarofsleep/article/details/51190407app

http://blog.csdn.net/lovesummerforever/article/details/36386207this

http://zhenkm0507.iteye.com/blog/546785url

http://www.cnblogs.com/wangyang108/p/5842275.htmlspa

http://dinguangx.iteye.com/blog/1845119.net

http://libinchinabj.iteye.com/blog/2178155debug

CAS4.2单点登陆如何配置多个系统登陆一次和退出到登陆页问题 200

一、我用CAS4.2搭建了cas服务端,客户端是3.4.1版本二、如今服务端配置好了,也能够经过我配置的客户端系统访问和查询数据库登陆三、问题:我配置了两个cas系统castest1和castest2,两个系统serverName分别配置为hhaip-cas1.com和hhaip-cas2.com,如今我访问castest1且登陆成功,而后同一浏览器访问castest2仍是跳转到登陆页面,预期应该直接跳转到我访问的页面才是四、问题2:我想退出到登陆页,可是我每次都退出到我设置的那个连接,且打开浏览器新标签访问我这个系统居然不会跳转到登陆页而是直接跳转到个人系统页面,即:我可能没有退出成功,下图是个人退出URL和客户端web.xml配置。五、注意个人cas-server是4.2版本和老版本差异很大,请你们不要复制其余的代码回答问题。

最佳答案
 
对于cas4.0在cas-server.xml中搜索logoutAction,将${cas.logout.followServiceRedirects:false}中的false改为true,以下:<bean id="logoutAction" class="org.jasig.cas.web.flow.LogoutAction"p:servicesManager-ref="servicesManager"p:followServiceRedirects="${cas.logout.followServiceRedirects:true}"/>至于cas4.2,cas-server.xml中少了不少东西,把这三行放到最后试试
相关文章
相关标签/搜索