Cas Ticket Issue in Jmeter

回眸只為那壹抹淺笑 提交于 2020-01-04 07:59:48

问题


I have a web application which uses CAS Ticket for user authentication purpose which is different for every login. I recorded the script in JMeter. Also I correlated the pages by filling up the Regular Expression Extractor as follows:

Recorded script has url: https://foo.com/j_spring_cas_security_check?ticket=ST-3101-QDTyjbbHoOHvgPMdRBIg-cas.

After applying all above I ran the script but got status fail displaying https://foo.com/j_spring_cas_security_check?ticket=Ticket_Not_Found.

It would be very helpful if someone could tell me what did I miss in my script?


回答1:


There is two ways for this,

if you have multiple username and password and you can use those with Jmeter, you can use those to generate CAS ST(Service ticket).

Another: default when CAS create ticket, it can be just used for one time.

you have to change values in ticketExpirationPolicies.xml of your cas server to use same ticket multiple times.

default location is: WEB_INF/spring-configuration/ticketExpirationPolicies.xml

change this to if you want 50 users to use same ticket

    <!-- This argument is the time a ticket can exist before its considered expired.  -->
    <constructor-arg
        index="1"
        value="100000" />
</bean>

<bean id="grantingTicketExpirationPolicy" class="org.jasig.cas.ticket.support.TimeoutExpirationPolicy">
    <!-- This argument is the time a ticket can exist before its considered expired.  -->
    <constructor-arg
        index="0"
        value="7200000" />
</bean>

Answer given by: VIVEK ADHIKARI




回答2:


It seems that an error happened when fetching ticket value from url's parameter list. Maybe you can add a hidden field on your page and set its value from this parameter.

<input type="hidden" id="ticket_key" value="ST-3101-QDTyjbbHoOHvgPMdRBIg-cas" />

Then you can get it by Regular Extractor

ticket_key=(.+)

Hope it helps.



来源:https://stackoverflow.com/questions/17465008/cas-ticket-issue-in-jmeter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!