Hi,

Probably not possible by just editing loginform.html, as you can see here:
https://github.com/apereo/cas/blob/master/support/cas-server-support-captcha-core/src/main/java/org/apereo/cas/web/flow/ValidateCaptchaAction.java

Even if you removed the recaptchtoken on the page, it still would check in 
the backend.

Since the use case is very specific, I don't think it is in CAS yet.

However, you might be able to do something like this to make your use case 
work:
1. Override ValidateCaptchaAction
  - In doExecute, check for your desired case and return null to stop 
recaptcha from activiting only in selected case
  - You can check the get param / check the flow value / check serviceId 
etc in here
2. Add a custom class extending CasCaptchaConfiguration
- Setup a Bean for validateCaptchaAction like 
this: 
https://github.com/apereo/cas/blob/master/support/cas-server-support-captcha/src/main/java/org/apereo/cas/web/flow/config/CasCaptchaConfiguration.java#L72
3. Then, setup your src/main/resources/META-INF/spring.factories to include 
your configuration

See if this is helpful to you

Cheers,
- Andy



On Thursday, 5 August 2021 at 00:12:00 UTC+8 [email protected] wrote:

> maybe it was wrong question . I want have recaptch in password change  
> view  but in login page i want disable it.  how can i mage it ?
>
>
>
> I am able rem code 
>
>
> /cas/cas11t /templates/fragments/loginform.html 
>
> <section class="cas-field">
>
>                         <div th:replace="nextor/fragments/recaptcha :: 
> recaptchaToken" />
>
>                         <input type="hidden" name="execution" 
> th:value="${flowExecutionKey}"/>
>                         <input type="hidden" name="_eventId" 
> value="submit"/>
>                         <input type="hidden" name="geolocation"/>
>
>                         <p 
> th:if="${#request.getMethod().equalsIgnoreCase('POST')}">
>                             <span th:each="entry : 
> ${httpRequestInitialPostParameters}" th:remove="tag">
>                                 <span th:each="entryValue : 
> ${entry.value}" th:remove="tag">
>                                     <input type="hidden" 
> th:name="${entry.key}" th:value="${entryValue}"/>
>                                 </span>
>                             </span>
>                         </p>
>                     </section>
>
>  however i cant see  recaptacha on login page  but i cannot log in. 
>
> poniedziałek, 26 lipca 2021 o 14:32:39 UTC+2 artur miś napisał(a):
>
>> This bellow is giving to me   posibility  to use  recaptch  in  view  
>> password change  and in main cas login page cas/login. 
>>
>> cas.authn.pm.captcha-enabled=true
>>
>>
>> cas.google-recaptcha.enabled=true
>> cas.google-recaptcha.verify-url=
>> https://www.google.com/recaptcha/api/siteverify
>> cas.google-recaptcha.site-key=6keya
>> cas.google-recaptcha.secret=6keyb
>>
>> does it exist sollution to limit view  recaptcha to  only  pm view    ?
>>
>

-- 
- 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/8518bc91-3e3e-4024-a0f1-763a11516e3dn%40apereo.org.

Reply via email to