在对CAS服务器进行proxyValidate / ticket调用之后,我无法检索XML响应。一切都得到了验证,并且正在使用正确的PGT和PGTIOU BUT 调用回调网址,因为应用程序分布在不同的服务器之间,我需要将PGTIOU映射到后端以便另一台能够检索它的服务器。
如果我可以从成功的proxyValidate(或seviceValidate)获取XML响应,显然这将是微不足道的,其中包括按照CAS 2.0 +协议中指定的用户和PGTIOU
我的配置如下:
<!-- begin CAS servlet filter -->
<filter>
<filter-name>CAS Authentication Filter</filter-name>
<filter-class>org.sakaiproject.login.filter.SakaiCasAuthenticationFilter</filter-class>
<init-param>
<param-name>casServerLoginUrl</param-name>
<param-value>https://cas.someplace.edu/login</param-value>
</init-param>
<init-param>
<param-name>serverName</param-name>
<param-value>https://${serverName}</param-value>
</init-param>
</filter>
<filter>
<filter-name>CAS Validation Filter</filter-name>
<filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
<init-param>
<param-name>casServerUrlPrefix</param-name>
<param-value>https://cas.someplace.edu</param-value>
</init-param>
<init-param>
<param-name>proxyCallbackUrl</param-name>
<param-value>https://test-sakai.someplace.edu/sakai-login-tool/pgtHandler</param-value>
</init-param>
<init-param>
<param-name>serverName</param-name>
<param-value>https://${serverName}</param-value>
</init-param>
</filter>
<filter>
<filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
<filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CAS Authentication Filter</filter-name>
<url-pattern>/container</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>CAS Validation Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
&#13;
我将在哪里获得成功的XML响应?验证由Cas20ProxyReceivingTicketValidationFilter完成,但似乎无法访问它。
感谢。
答案 0 :(得分:1)
Cas20ProxyReceivingTicketValidationFilter
有一个(PGTIOU,PGT)的内部缓存,默认情况下在内存中:https://github.com/apereo/java-cas-client/blob/master/cas-client-core/src/main/java/org/jasig/cas/client/validation/Cas20ProxyReceivingTicketValidationFilter.java#L78对于分布式应用程序,您应该提供自己的分布式缓存。
机制如下:
客户验证 - &gt; CAS通过指定的callbackURL发回PGTIOU / PGT - &GT; CAS回复原始请求和代理/服务验证过滤器处理它,并尝试使用XML体内的PGTIOU检索可能存储的PGT。
要使所有这些工作,必须在xml / spring配置中定义proxyCallbackUrl和proxyGrantingTicketStorageClass。