Examples of checkAnswer()


Examples of net.tanesha.recaptcha.ReCaptchaImpl.checkAnswer()

           reCaptcha.setPrivateKey(privateKey);

           String challenge = request.getParameter("recaptcha_challenge_field");
           String uresponse = request.getParameter("recaptcha_response_field");
          
           ReCaptchaResponse reCaptchaResponse = reCaptcha.checkAnswer(remoteAddr, challenge, uresponse);

           return reCaptchaResponse.isValid();
     }

}
View Full Code Here

Examples of net.tanesha.recaptcha.ReCaptchaImpl.checkAnswer()

        */
        ReCaptchaImpl reCaptcha = new ReCaptchaImpl();
          reCaptcha.setPrivateKey(PRIVATE_KEY);
         
          ReCaptchaResponse reCaptchaResponse =
              reCaptcha.checkAnswer(remoteIp, challenge, response);
         
          if (!reCaptchaResponse.isValid()) {
              setError(FIELD_RESPONSE, "Please try again." + reCaptchaResponse.getErrorMessage());
              log.warning(FIELD_RESPONSE + " " + "Please try again." + reCaptchaResponse.getErrorMessage());
          }  
View Full Code Here

Examples of net.tanesha.recaptcha.ReCaptchaImpl.checkAnswer()

    ReCaptchaImpl reCaptcha = new ReCaptchaImpl();
    reCaptcha.setPrivateKey("6LcOO-kSAAAAAM2wCrSSw-0bB-cWMfTxH5YxGUIs");

    String challenge = req.getParameter("recaptcha_challenge_field");
    String uresponse = req.getParameter("recaptcha_response_field");
    ReCaptchaResponse reCaptchaResponse = reCaptcha.checkAnswer(remoteAddr, challenge, uresponse);

    System.out.println(role);
    if(!role.equals("empty") && reCaptchaResponse.isValid()){
      return new ModelAndView("LoginSuccess");
    }else{
View Full Code Here

Examples of net.tanesha.recaptcha.ReCaptchaImpl.checkAnswer()

    public boolean isSuccessful(String challenge, String response) {
        ReCaptchaImpl reCaptcha = new ReCaptchaImpl();
        reCaptcha.setPrivateKey(PRIVATE_KEY);

        ReCaptchaResponse reCaptchaResponse = reCaptcha.checkAnswer(CAPTCHA_URL, challenge, response);
        if(reCaptchaResponse.isValid()) {
            return true;
        }
        else {
            return false;
View Full Code Here

Examples of net.tanesha.recaptcha.ReCaptchaImpl.checkAnswer()

    if (this.getRecaptchaAfterEnabled()) {
      String remoteAddr = ServletActionContext.getRequest().getRemoteAddr();
      ReCaptchaImpl reCaptcha = new ReCaptchaImpl();
      String privateKey = this.getConfigManager().getParam(JpwebdynamicformSystemConstants.RECAPTCHA_PRIVATEKEY_PARAM_NAME);
      reCaptcha.setPrivateKey(privateKey);
      ReCaptchaResponse reCaptchaResponse = reCaptcha.checkAnswer(remoteAddr,
          this.getRecaptcha_challenge_field(), this.getRecaptcha_response_field());
      if (!reCaptchaResponse.isValid()) {
        this.addFieldError("recaptcha_response_field", this.getText("Errors.webdynamicform.captcha.notValid"));
      }
    }
View Full Code Here

Examples of net.tanesha.recaptcha.ReCaptchaImpl.checkAnswer()

    if (this.getRecaptchaEnabled()) {
      String remoteAddr = ServletActionContext.getRequest().getRemoteAddr();
      ReCaptchaImpl reCaptcha = new ReCaptchaImpl();
      String privateKey = this.getConfigManager().getParam(JpwebdynamicformSystemConstants.RECAPTCHA_PRIVATEKEY_PARAM_NAME);
      reCaptcha.setPrivateKey(privateKey);
      ReCaptchaResponse reCaptchaResponse = reCaptcha.checkAnswer(remoteAddr,
          this.getRecaptcha_challenge_field(), this.getRecaptcha_response_field());
      if (!reCaptchaResponse.isValid()) {
        this.addFieldError("recaptcha_response_field", this.getText("Errors.webdynamicform.captcha.notValid"));
      }
    }
View Full Code Here

Examples of net.tanesha.recaptcha.ReCaptchaImpl.checkAnswer()

        String challenge = request.getParameter("recaptcha_challenge_field");
        String uresponse = request.getParameter("recaptcha_response_field");
        if (challenge == null || uresponse == null) {
          throw new ValidatorException(new FacesMessage("No ReCaptcha text. Maybe you have JavaScript disabled. Please enable and retry."));
        }
        ReCaptchaResponse reCaptchaResponse = reCaptcha.checkAnswer(remoteAddr, challenge, uresponse);

        if (reCaptchaResponse.isValid()) {
            return;
        } else {
            throw new ValidatorException(new FacesMessage("Invalid ReCaptcha text. Please try again."));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.