JMeter+CAS单点登录测试问题


最近在使用jmeter对一个应用进行简单的性能测试。这个应用包含CAS单点登录模块。根据CAS 协议,jmeter中的登陆请求中配置好需要提供的参数(username/password/lt/service/_eventId),执行脚本后,登陆成功,返回的数据却是CAS登陆成功的页面数据,并不是我在service参数中指定的地址。

google一番,没有找到满意的答案(可能是搜索技巧不够)。有的用户反馈说可能是jmeter不能执行页面返回数据中的js跳转,要使用jsp跳转。但这样岂不是要修改CAS的登陆成功的页面?我目前没有修改任何源码的权限,只能使用这个应用的环境。

请问大家有遇到过这类问题的吗?

单点登录

萌之死忠党 13 years, 4 months ago

在此之前对CAS了解还不充分,经过查阅官方文档的协议说明,找到如下内容:
(from http://www.jasig.org/cas/protocol )

2.2.4. response
One of the following responses MUST be provided by /login when it is operating as a credential acceptor.

successful login: redirect the client to the URL specified by the "service" parameter in a manner that will not cause the client's credentials to be forwarded to the service. This redirection MUST result in the client issuing a GET request to the service. The request MUST include a valid service ticket, passed as the HTTP request parameter, "ticket". See Appendix B for more information. If "service" was not specified, CAS MUST display a message notifying the client that it has successfully initiated a single sign-on session.

原来是这样,需要对CAS的login地址重新发送一次GET请求,传递service、ticket两个参数即可跳转页面到service地址。这里的ticket就是登陆请求中的lt值。

于是,页面成功跳转,测试得以继续。。。

colcule answered 13 years, 4 months ago

Your Answer