import com.google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient; import com.google.recaptchaenterprise.v1.Assessment; import com.google.recaptchaenterprise.v1.CreateAssessmentRequest; import com.google.recaptchaenterprise.v1.Event; import com.google.recaptchaenterprise.v1.ProjectName; import com.google.recaptchaenterprise.v1.RiskAnalysis.ClassificationReason; import java.io.IOException; public class CreateAssessment { public static void main(String[] args) throws IOException { // TODO: Replace the token and reCAPTCHA action variables before running the sample. String projectID = "christina-stroeh"; String recaptchaKey = "6LdHikMsAAAAAMX0QcTMio2wwpsIEQSLYIil36GP"; String token = "action-token"; String recaptchaAction = "action-name"; createAssessment(projectID, recaptchaKey, token, recaptchaAction); } /** * Create an assessment to analyze the risk of a UI action. * * @param projectID : Your Google Cloud Project ID. * @param recaptchaKey : The reCAPTCHA key associated with the site/app * @param token : The generated token obtained from the client. * @param recaptchaAction : Action name corresponding to the token. */ public static void createAssessment( String projectID, String recaptchaKey, String token, String recaptchaAction) throws IOException { // Create the reCAPTCHA client. // TODO: Cache the client generation code (recommended) or call client.close() before exiting the method. try (RecaptchaEnterpriseServiceClient client = RecaptchaEnterpriseServiceClient.create()) { // Set the properties of the event to be tracked. Event event = Event.newBuilder().setSiteKey(recaptchaKey).setToken(token).build(); // Build the assessment request. CreateAssessmentRequest createAssessmentRequest = CreateAssessmentRequest.newBuilder() .setParent(ProjectName.of(projectID).toString()) .setAssessment(Assessment.newBuilder().setEvent(event).build()) .build(); Assessment response = client.createAssessment(createAssessmentRequest); // Check if the token is valid. if (!response.getTokenProperties().getValid()) { System.out.println( "The CreateAssessment call failed because the token was: " + response.getTokenProperties().getInvalidReason().name()); return; } // Check if the expected action was executed. if (!response.getTokenProperties().getAction().equals(recaptchaAction)) { System.out.println( "The action attribute in reCAPTCHA tag is: " + response.getTokenProperties().getAction()); System.out.println( "The action attribute in the reCAPTCHA tag " + "does not match the action (" + recaptchaAction + ") you are expecting to score"); return; } // Get the risk score and the reason(s). // For more information on interpreting the assessment, see: // https://cloud.google.com/recaptcha-enterprise/docs/interpret-assessment for (ClassificationReason reason : response.getRiskAnalysis().getReasonsList()) { System.out.println(reason); } float recaptchaScore = response.getRiskAnalysis().getScore(); System.out.println("The reCAPTCHA score is: " + recaptchaScore); // Get the assessment name (id). Use this to annotate the assessment. String assessmentName = response.getName(); System.out.println( "Assessment name: " + assessmentName.substring(assessmentName.lastIndexOf("/") + 1)); } } }
top of page
Christina Stroeh logo

You have a story to tell. 

Together we can unleash the extraordinary power of the arts to transform  communities.

Queen-Bea-Poster_laurels_7.jpg

Award-Winning Film!

Queen
Bea


EMPOWERING GIRLS TO BE CURIOUS COMPASSIONATE & CAPABLE

AVAILABLE NOW!

Queen Bea
Activity Book

Image from Queen Bea Activity Book by Lais Fonseca and Christina Stroeh

FOR ALL AGES

Activities to stimulate your creativity and bring joyful play into your life. 


created by Lais Fonseca
and Christina Stroeh

Blessing & True Film Poster

Blessing & True

A FEMALE FOCUSED FEATURE LENGTH FILM  shot in Switzerland
in  April 2024

Charlie Reading to Kids.jpeg

Cry Love

A PLAY WITH MUSIC

ABOUT MEMORY AND TRUTH

Get the book now (.pdf)  for $8.

So Comes Love

MUSIC TO SOOTHE THE SOUL

Walking with Charlie

A HEARTWARMING STORY
FOR AGES 4-100

bottom of page