Google reCAPTCHA
reCAPTCHA is a Google service that
protects your CAS deployment from spam and abuse.
It uses advanced risk analysis techniques to tell humans and bots
apart. CAS supports the reCAPTCHA API v2
and v3
.
Support is enabled by including the following module in the WAR Overlay:
1
2
3
4
5
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-captcha</artifactId>
<version>${cas.version}</version>
</dependency>
1
implementation "org.apereo.cas:cas-server-support-captcha:${project.'cas.version'}"
1
2
3
4
5
6
7
8
9
dependencyManagement {
imports {
mavenBom "org.apereo.cas:cas-server-support-bom:${project.'cas.version'}"
}
}
dependencies {
implementation "org.apereo.cas:cas-server-support-captcha"
}
1
2
3
4
5
6
7
8
9
10
dependencies {
/*
The following platform references should be included automatically and are listed here for reference only.
implementation enforcedPlatform("org.apereo.cas:cas-server-support-bom:${project.'cas.version'}")
implementation platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
*/
implementation "org.apereo.cas:cas-server-support-captcha"
}
The following settings and properties are available from the CAS configuration catalog:
cas.google-recaptcha.enabled=true
Whether google reCAPTCHA should be enabled.
|
cas.google-recaptcha.score=0.5
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.
|
cas.google-recaptcha.secret=
The google reCAPTCHA site secret.
|
cas.google-recaptcha.site-key=
The google reCAPTCHA site key.
|
cas.google-recaptcha.activate-for-ip-address-pattern=
A regular expression pattern to indicate that captcha should be activated when the remote IP address matches this pattern, and otherwise skipped and disabled.
|
cas.google-recaptcha.invisible=false
Whether google reCAPTCHA invisible should be enabled.
|
cas.google-recaptcha.position=bottomright
The google reCAPTCHA badge position (only if invisible is enabled). Accepted values are:
|
cas.google-recaptcha.verify-url=https://www.google.com/recaptcha/api/siteverify
The google reCAPTCHA endpoint for verification of tokens and input.
|
cas.google-recaptcha.version=GOOGLE_RECAPTCHA_V2
Indicate the version of the recaptcha api. Accepted values are:
|