cas单点登录客户端验证通过后返回,有不明白的地方,望解惑,谢谢!

寒风中游泳 2015-07-31 10:46:53
今天学习 CAS 单点登录,根据网上的教程一步一步都很顺利,server 也启动了,客户端的请求也都能验证了,
但是有个问题闹不明白,
服务端的tomcat 中的server.xml 是这么配置的:

<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />

<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="d:/tools/cas/key/caskey"
keystorePass="111111"/>


客户端的web.xml 文件中是这么配置的:
 
<!-- 该过滤器负责用户的认证工作,必须启用它 -->
<filter>
<filter-name>CASFilter</filter-name>
<filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
<init-param>
<param-name>casServerLoginUrl</param-name>
<param-value>https://localhost:8443/cas/login</param-value>
</init-param>
<init-param>
<!--这里的server是服务端的IP -->
<param-name>serverName</param-name>
<param-value>http://localhost:8080</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CASFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<!-- 该过滤器负责对Ticket的校验工作,必须启用它 -->
<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://localhost:8443/cas</param-value>
</init-param>
<init-param>
<param-name>serverName</param-name>
<param-value>http://localhost:8080</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CAS Validation Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>


上面的配置有一个点一直不明白,就是:

<init-param>
<param-name>serverName</param-name>
<param-value>http://localhost:8080</param-value>
</init-param>

我客户端是在端口80上启动的,访问 http://localhost/index.html 会跳转到登录验证,登录成功后确返回到 http://localhost:8080/index.html?ticket=ST-1-hBixgj7pOqb1gRbpOZs1-cas01.example.org 页面显示空白
想问一下,怎么返回到 客户端的页面,即返回到:http://localhost/index.html

我如果访问 http://localhost/test.html 就是跳转到 http://localhost:8080/test.html?ticket=ST-1-hBixgj7pOqb1gRbpOZs1-cas01.example.org 页面也显示空白

这样正确吗?服务器登录认证完了不是应该回到客户端这边的吗?
...全文
218 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧