版本
cas-server-3.5.0
cas-client-3.2.1
研究cas的相关搜索关键字
cas ticket
cas login-webflow.xml
在退出地址列表中url后带上/
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean" lazy-init="false"> <property name="staticMethod" value="cn.ql.sso.auth.SignoutServers.setServers" /> <property name="arguments"> <list> <value>http://192.168.2.3:8080/Plat/</value> <value>http://192.168.2.3:8080/base/</value> <value>http://192.168.2.5:8080/Plat/</value> <value>http://192.168.2.5:8080/base/</value> </list> </property> </bean>
其他说明:
org.jasig.cas.web.LogoutController.java
protected ModelAndView handleRequestInternal( final HttpServletRequest request, final HttpServletResponse response) throws Exception { final String ticketGrantingTicketId = this.ticketGrantingTicketCookieGenerator.retrieveCookieValue(request); final String service = request.getParameter("service"); if (ticketGrantingTicketId != null) { this.centralAuthenticationService .destroyTicketGrantingTicket(ticketGrantingTicketId); this.ticketGrantingTicketCookieGenerator.removeCookie(response); this.warnCookieGenerator.removeCookie(response); } if (this.followServiceRedirects && service != null) { return new ModelAndView(new RedirectView(service)); } return new ModelAndView(this.logoutView); }
sso发退出请求
org.jasig.cas.util.HttpClient.java
private Boolean call(String server) { HttpURLConnection connection = null; BufferedReader in = null; try { if (log.isDebugEnabled()) { log.debug("Attempting to access " + server); } final URL logoutUrl = new URL(server); final String output = "logoutRequest=" + URLEncoder.encode(message, "UTF-8"); connection = (HttpURLConnection) logoutUrl.openConnection(); connection.setDoInput(true); connection.setDoOutput(true); connection.setRequestMethod("POST"); connection.setReadTimeout(readTimeout); connection.setConnectTimeout(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(); 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 SocketTimeoutException e) { log.warn("Socket Timeout Detected while attempting to send message to [" + url + "]."); return false; } catch (final Exception e) { log.warn("Error Sending message to url endpoint [" + url + "]. Error is [" + e.getMessage() + "]"); return false; } finally { if (in != null) { try { in.close(); } catch (final IOException e) { // can't do anything } } if (connection != null) { connection.disconnect(); } } }
客户端,接收退出请求
org.jasig.cas.client.session.SingleSignOutFilter
public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain filterChain) throws IOException, ServletException { final HttpServletRequest request = (HttpServletRequest) servletRequest; if (handler.isTokenRequest(request)) { handler.recordSession(request); } else if (handler.isLogoutRequest(request)) { handler.destroySession(request); // Do not continue up filter chain return; } else { log.trace("Ignoring URI " + request.getRequestURI()); } filterChain.doFilter(servletRequest, servletResponse); }
参考:
http://www.iteye.com/topic/1129751
相关推荐
只需要修改 casClientConfig casServerUrlPrefix="http://localhost:8442/cas/" serverName="localhost:20950" 里面对应的值 casServerLoginUrl 是CAS服务器登录的地址; casServerUrlPrefix 是CAS服务器地址 ...
此文档自己亲手从0开始一步一步配置的详尽过程,其中包括keytool创建 、ticket、tomcat配置cas、自定义登录页面,处理服务器返回的乱码,服务退出、cas服务器返回多数据等等文档 包括SSO原理图,以及认证流程图等
JEECG BPM 单点登录说明文档(kisso集成),已经在项目中使用。
SSO Agent 负责管理操作员的登录/退出流程,操作员在应用中的SSO 的Session管理,并具SSO Agent 负责收接应用发送过的操作员登录,退出等信息交给应用进行处理。这种方式对应用接入的开发来说,优点是开发工作量比较...
淘淘商城单点登录接口文档
操作员单点登录。 应用系统互信认证。 操作员、组织信息的访问和维护功能。 应用接入SSO系统主要可以通过两种方式:Out-Application 及In-Application方式。 Out-Application模式: 这种方式通过SSO Agent ...
原作者没有实现单点退出功能,再次基础上实现了单点退出: 原理就是每一个sso客户端退出时候,添加Redis保存当前退出的用户名。每个系统实现切面aspect注解添加到控制器上面,每个请求根据当前系统的用户名去纠正...
使用Windows Identity Foundation / System.IdentityModel / WsFederation和Asp.Net Mvc实现的单点登录,单点退出原型。 运行此解决方案 请创建一个自签名证书,并将其放置在计算机上的个人存储中。 请注意,...
包含cas源码、cas使用说明文档(包含配置信息)、连接数据库所需jar包、cas服务端自定义返回值等
golang单点登录系统(go-sso) 这是一个基于Go语言开发的单点登录系统,实现手机号注册,手机号+验证码登录,手机号+密码登录,账号登出等功能,用户认证采用cookie和jwt两种方式。方法已提供,仅需根据短信通道提供...
这样一般都会存在一个问题:如果用户没有正常退出系统,那么他接下来继续登录的时候,因为Session没有过期等问题,会被拒绝继续登录系统,只能等待Session过期后才能登录。本文介绍的方法是采用类似于MSN登陆的方法...
搜狐单点登录。有具体实现源代码、原理图、开发设计文档。一个站点登陆,其它站点同时登陆,退出也一样。
CAS(中央身份验证服务)是Web的单点登录/单点退出协议。 我们假设您已经熟悉CAS协议,如果不熟悉,请在使用前阅读本。安装$ npm install http-cas-client特征唱歌登录(SSO) 带有axios api的CAS代理,用于POST,...
本系统基于CAS,包含的功能有:统一认证(单点登录、单点退出)、用户信息统一管理、用户权限管理等 maven工程 ---------------------------------------------------------------------------------------------...
-- 用于单点退出,该过滤器用于实现单点登出功能,可选配置 --> org.jasig.cas.client.session.SingleSignOutHttpSessionListener <!-- 该过滤器用于实现单点登出功能,可选配置。 --> ...
基于cas 4.1改造实现单点登陆。自定义了服务注册中心、登陆控制(基于dubbo)、令牌服务类、退出通知类及个别微改。