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 
<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 <https://github.com/UniconLabs/duct>

Cheers,
D.



> On May 9, 2016, at 3:38 PM, Yan Zhou <[email protected]> wrote:
> 
> 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
> 
> -- 
> 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 [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/a/apereo.org/group/cas-user/ 
> <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
>  
> <https://groups.google.com/a/apereo.org/d/msgid/cas-user/91586f22-25c8-46ce-a0f7-0189f4dd1d89%40apereo.org?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/a/apereo.org/d/optout 
> <https://groups.google.com/a/apereo.org/d/optout>.

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/A63BCDD3-8325-4E00-979E-180C698FD153%40unicon.net.
For more options, visit https://groups.google.com/a/apereo.org/d/optout.

Reply via email to