Class GoogleRecaptchaProperties

java.lang.Object
org.apereo.cas.configuration.model.support.captcha.GoogleRecaptchaProperties
All Implemented Interfaces:
Serializable, CasFeatureModule

@RequiresModule(name="cas-server-support-captcha") public class GoogleRecaptchaProperties extends Object implements CasFeatureModule, Serializable
Since:
5.0.0
See Also:
  • Constructor Details

    • GoogleRecaptchaProperties

      public GoogleRecaptchaProperties()
  • Method Details

    • getVersion

      Indicate the version of the recaptcha api. Accepted values are: V2, V3.
    • isEnabled

      public boolean isEnabled()
      Whether google reCAPTCHA should be enabled.
    • getSiteKey

      public String getSiteKey()
      The google reCAPTCHA site key.
    • getVerifyUrl

      public String getVerifyUrl()
      The google reCAPTCHA endpoint for verification of tokens and input.
    • getSecret

      public String getSecret()
      The google reCAPTCHA site secret.
    • isInvisible

      public boolean isInvisible()
      Whether google reCAPTCHA invisible should be enabled.
    • getPosition

      public String getPosition()
      The google reCAPTCHA badge position (only if invisible is enabled). Accepted values are:
      • bottomright: bottom right corner, default value.
      • bottomleft: bottom left corner
      • inline: allows to control the CSS.
    • getScore

      public double getScore()
      reCAPTCHA v3 returns a score (1.0 is very likely a good interaction, 0.0 is very likely a bot). reCAPTCHA learns by seeing real traffic on your site. For this reason, scores in a staging environment or soon after implementing may differ from production. As reCAPTCHA v3 doesn't ever interrupt the user flow, you can first run reCAPTCHA without taking action and then decide on thresholds by looking at your traffic in the admin console. By default, you can use a threshold of 0.5.
    • getActivateForIpAddressPattern

      public String getActivateForIpAddressPattern()
      A regular expression pattern to indicate that captcha should be activated when the remote IP address matches this pattern, and otherwise skipped and disabled.
    • setVersion

      Indicate the version of the recaptcha api. Accepted values are: V2, V3.
      Returns:
      this.
    • setEnabled

      public GoogleRecaptchaProperties setEnabled(boolean enabled)
      Whether google reCAPTCHA should be enabled.
      Returns:
      this.
    • setSiteKey

      public GoogleRecaptchaProperties setSiteKey(String siteKey)
      The google reCAPTCHA site key.
      Returns:
      this.
    • setVerifyUrl

      public GoogleRecaptchaProperties setVerifyUrl(String verifyUrl)
      The google reCAPTCHA endpoint for verification of tokens and input.
      Returns:
      this.
    • setSecret

      public GoogleRecaptchaProperties setSecret(String secret)
      The google reCAPTCHA site secret.
      Returns:
      this.
    • setInvisible

      public GoogleRecaptchaProperties setInvisible(boolean invisible)
      Whether google reCAPTCHA invisible should be enabled.
      Returns:
      this.
    • setPosition

      public GoogleRecaptchaProperties setPosition(String position)
      The google reCAPTCHA badge position (only if invisible is enabled). Accepted values are:
      • bottomright: bottom right corner, default value.
      • bottomleft: bottom left corner
      • inline: allows to control the CSS.
      Returns:
      this.
    • setScore

      public GoogleRecaptchaProperties setScore(double score)
      reCAPTCHA v3 returns a score (1.0 is very likely a good interaction, 0.0 is very likely a bot). reCAPTCHA learns by seeing real traffic on your site. For this reason, scores in a staging environment or soon after implementing may differ from production. As reCAPTCHA v3 doesn't ever interrupt the user flow, you can first run reCAPTCHA without taking action and then decide on thresholds by looking at your traffic in the admin console. By default, you can use a threshold of 0.5.
      Returns:
      this.
    • setActivateForIpAddressPattern

      public GoogleRecaptchaProperties setActivateForIpAddressPattern(String activateForIpAddressPattern)
      A regular expression pattern to indicate that captcha should be activated when the remote IP address matches this pattern, and otherwise skipped and disabled.
      Returns:
      this.