I was trying to add Google Recaptcha to CAS 

This is my cas.properties 

#
#Google reCAPTCHA
#

cas.googleRecaptcha.enabled=true
cas.googleRecaptcha.verifyUrl=https://www.google.com/recaptcha/api/siteverify
cas.googleRecaptcha.siteKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxx
cas.googleRecaptcha.secret=xxxxxxxxxxxxxxxxxxxxxxxxxx

cas.googleRecaptcha.invisible=false
cas.googleRecaptcha.position=bottomright


This is the tomcat log
2018-11-09 15:05:21,513 INFO 
[org.apereo.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit 
trail record BEGIN
=============================================================
WHO: audit:unknown
WHAT: [event=success,timestamp=Fri Nov 09 15:05:21 MYT 
2018,source=RankedMultifactorAuthenticationProviderWebflowEventResolver]
ACTION: AUTHENTICATION_EVENT_TRIGGERED
APPLICATION: CAS
WHEN: Fri Nov 09 15:05:21 MYT 2018
CLIENT IP ADDRESS: 127.0.0.1
SERVER IP ADDRESS: 127.0.0.1
=============================================================

>
2018-11-09 15:05:25,358 INFO 
[org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <[0] 
expired tickets removed.>
2018-11-09 15:05:31,313 ERROR [org.thymeleaf.TemplateEngine] - 
<[THYMELEAF][https-jsse-nio-8443-exec-8] Exception processing template 
"casLoginView": Exception evaluating SpringEL expression: "recaptchaSiteKey 
!= null AND recaptchaInvisible != null AND recaptchaSiteKey AND 
!recaptchaInvisible" (template: "fragments/loginform" - line 116, col 46)>
org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating 
SpringEL expression: "recaptchaSiteKey != null AND recaptchaInvisible != 
null AND recaptchaSiteKey AND !recaptchaInvisible" (template: 
"fragments/loginform" - line 116, col 46)
at 
org.thymeleaf.spring5.expression.SPELVariableExpressionEvaluator.evaluate(SPELVariableExpressionEvaluator.java:290)
 
~[thymeleaf-spring5-3.0.10.RELEASE.jar!/:3.0.10.RELEASE]
at 
org.thymeleaf.standard.expression.VariableExpression.executeVariableExpression(VariableExpression.java:166)
 
~[thymeleaf-3.0.10.RELEASE.jar!/:3.0.10.RELEASE]
at 
org.thymeleaf.standard.expression.SimpleExpression.executeSimple(SimpleExpression.java:66)
 
~[thymeleaf-3.0.10.RELEASE.jar!/:3.0.10.RELEASE]
at 
org.thymeleaf.standard.expression.Expression.execute(Expression.java:109) 
~[thymeleaf-3.0.10.RELEASE.jar!/:3.0.10.RELEASE]
at 
org.thymeleaf.standard.expression.Expression.execute(Expression.java:138) 
~[thymeleaf-3.0.10.RELEASE.jar!/:3.0.10.RELEASE]

at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) 
~[tomcat-embed-core-9.0.12.jar!/:9.0.12]
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 
~[?:?]
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 
~[?:?]
at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 
~[tomcat-embed-core-9.0.12.jar!/:9.0.12]
at java.lang.Thread.run(Thread.java:834) ~[?:?]
2018-11-09 15:05:32,050 ERROR [org.thymeleaf.TemplateEngine] - 
<[THYMELEAF][https-jsse-nio-8443-exec-8] Exception processing template 
"error": Exception evaluating SpringEL expression: "#fields.hasErrors('*')" 
(template: "fragments/loginform" - line 26, col 57)>
org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating 
SpringEL expression: "#fields.hasErrors('*')" (template: 
"fragments/loginform" - line 26, col 57)
at 
org.thymeleaf.spring5.expression.SPELVariableExpressionEvaluator.evaluate(SPELVariableExpressionEvaluator.java:290)
 
~[thymeleaf-spring5-3.0.10.RELEASE.jar!/:3.0.10.RELEASE]
at 
org.thymeleaf.standard.expression.VariableExpression.executeVariableExpression(VariableExpression.java:166)
 
~[thymeleaf-3.0.10.RELEASE.jar!/:3.0.10.RELEASE]



This is the line 116 in the loginform.html



<section class="row" th:if="${recaptchaSiteKey != null AND 
recaptchaInvisible != null AND recaptchaSiteKey AND !recaptchaInvisible}">
<div class="g-recaptcha" th:attr="data-sitekey=${recaptchaSiteKey}"/>
</section>

<input type="hidden" name="execution" th:value="${flowExecutionKey}"/>
<input type="hidden" name="_eventId" value="submit"/>
<input type="hidden" name="geolocation"/>
<input class="btn btn-block btn-submit"
th:unless="${recaptchaSiteKey != null AND recaptchaInvisible != null AND 
recaptchaSiteKey AND recaptchaInvisible}"
name="submit"
accesskey="l"
th:value="#{screen.welcome.button.login}"
tabindex="6"
type="submit"
value="Login3"
/>
<button class="btn btn-block btn-submit g-recaptcha"
th:if="${recaptchaSiteKey != null AND recaptchaInvisible != null AND 
recaptchaSiteKey AND recaptchaInvisible}"
th:attr="data-sitekey=${recaptchaSiteKey}, data-badge=${recaptchaPosition}"
data-callback="onSubmit"
name="submitBtn"
accesskey="l"
th:text="#{screen.welcome.button.login}"
tabindex="6"
/>

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
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+unsubscr...@apereo.org.
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/a1c2f002-9e28-45af-a737-eb07e6bb6db9%40apereo.org.

Reply via email to