Skip to content

Commit 4a116b1

Browse files
loicgelleLoïc Gelle
andauthored
docs: add ja4 to CreateAssessment code snippet used in recaptcha cloud docs (GoogleCloudPlatform#10011)
Co-authored-by: Loïc Gelle <lgelle@google.com>
1 parent 7ff8c8d commit 4a116b1

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

recaptcha_enterprise/snippets/src/main/java/recaptcha/CreateAssessment.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ public static void main(String[] args) throws IOException {
3636
String recaptchaAction = "action-name";
3737
String userIpAddress = "user-ip-address";
3838
String userAgent = "user-agent";
39-
String ja3 = "ja3"
39+
String ja3 = "ja3";
40+
String ja4 = "ja4";
4041

41-
createAssessment(projectID, recaptchaSiteKey, token, recaptchaAction, userIpAddress, userAgent, ja3);
42+
createAssessment(projectID, recaptchaSiteKey, token, recaptchaAction, userIpAddress, userAgent, ja3, ja4);
4243
}
4344

4445
/**
@@ -53,9 +54,10 @@ public static void main(String[] args) throws IOException {
5354
* @param userIpAddress: IP address of the user sending a request.
5455
* @param userAgent: User agent is included in the HTTP request in the request header.
5556
* @param ja3: JA3 associated with the request.
57+
* @param ja4: JA4 associated with the request.
5658
*/
5759
public static void createAssessment(
58-
String projectID, String recaptchaSiteKey, String token, String recaptchaAction, String userIpAddress, String userAgent, String ja3)
60+
String projectID, String recaptchaSiteKey, String token, String recaptchaAction, String userIpAddress, String userAgent, String ja3, String ja4)
5961
throws IOException {
6062
// Initialize client that will be used to send requests. This client only needs to be created
6163
// once, and can be reused for multiple requests. After completing all of your requests, call
@@ -69,6 +71,7 @@ public static void createAssessment(
6971
.setToken(token)
7072
.setUserIpAddress(userIpAddress)
7173
.setJa3(ja3)
74+
.setJa4(ja4)
7275
.setUserAgent(userAgent)
7376
.build();
7477

0 commit comments

Comments
 (0)