Why get Invalid Login Ticket error?

239 views
Skip to first unread message

Yan Zhou

unread,
May 9, 2016, 3:38:38 PM5/9/16
to CAS Community
Hi there, 

I am writing java code to simulate login to CAS protected web app., so that our QA automation team can use that to test apps protected by CAS, without manually login to CAS over and over.  

I have carefully preserved the cookie and tickets values in each calls as browser would., but when my code calls the /cas/login endpoint to authenticate user credential, I always gets error:

You cannot attempt to re-submit a form that has been submitted already.

On server side, it says: invalid login ticket, even though the ticket is indeed valid. 

2016-05-09 19:29:59,146 DEBUG [org.jasig.cas.web.flow.GenerateLoginTicketAction] - Generated login ticket LT-2514-G5i7xw4qGewjAgGnCPFwYtcTOcNypo-devcas02.dev.medplus.com

2016-05-09 19:30:07,872 WARN [org.jasig.cas.web.flow.AuthenticationViaFormAction] - Invalid login ticket [LT-2514-G5i7xw4qGewjAgGnCPFwYtcTOcNypo-devcas02.dev.medplus.com]

what is the purpose of the following check in AuthenticationViaFormAction?

    protected boolean checkLoginTicketIfExists(final RequestContext context) {
        final String loginTicketFromFlowScope = WebUtils.getLoginTicketFromFlowScope(context);
        final String loginTicketFromRequest = WebUtils.getLoginTicketFromRequest(context);


Thanks,
Yan

Dmitriy Kopylenko

unread,
May 9, 2016, 3:54:44 PM5/9/16
to Yan Zhou, CAS Community
CAS' /login resource was never designed for non-human interactive login transaction "edge service” and this "login ticket” entity was designed as an opaque token to prevent any CSRF type of replay attacks, etc. For the automated testing tools you might need to choose to use CAS’ REST resources: https://apereo.github.io/cas/4.2.x/protocol/REST-Protocol.html

Her’s one such “unscientific” smoke testing tool using CAS’ REST API: https://github.com/UniconLabs/duct

Cheers,
D.



--
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To post to this group, send email to cas-...@apereo.org.
Visit this group at https://groups.google.com/a/apereo.org/group/cas-user/.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/91586f22-25c8-46ce-a0f7-0189f4dd1d89%40apereo.org.
For more options, visit https://groups.google.com/a/apereo.org/d/optout.

Reply all
Reply to author
Forward
0 new messages