Hi,
As per our requirement,we need to configure captcha on registration page.For this i followed below link
http://doanduyhai.wordpress.com/2012/08 ... -security/
In this tutorial they have configured captcha in login page,Same functionality i have done for registration purpose.
I have some couple of doubts here
1.After creating UsernamePasswordAuthenticationFilter.java where i need to keep this file
2.For B Spring MVC Controller for login page i have changed in registration controller to
@RequestMapping(method=RequestMethod.POST)
public String processRegister(HttpServletRequest request, HttpServletResponse response, Model model,
@ModelAttribute("registrationForm") RegisterCustomerForm registerCustomerForm, BindingResult errors) throws ServiceException {
ReCaptchaImpl reCaptcha = new ReCaptchaImpl();
reCaptcha.setPrivateKey("6LdLfeUSAAAAANrm334ENVbsQtVFuZ6MA5x9xQ9l");
String remoteAddr = request.getRemoteAddr();
String challengeField = request.getParameter("recaptcha_challenge_field");
String responseField = request.getParameter("recaptcha_response_field");
ReCaptchaResponse reCaptchaResponse = reCaptcha.checkAnswer(remoteAddr, challengeField, responseField);
if(!reCaptchaResponse.isValid())
{
model.addAttribute("invalidCaptcha", "Captcha Is Invalid");
return "home";
}
return super.processRegister(registerCustomerForm, errors, request, response, model);
}
3. Added code in register.html
<script type="text/javascript"
src="http://www.google.com/recaptcha/api/challenge?k=your_public_recaptcha_key">
</script>
<noscript>
<iframe src="http://www.google.com/recaptcha/api/noscript?k=6LdLfeUSAAAAABBYifGvYKEDLjUXH68xy7KXPh6w" height="300" width="500" > </iframe >
<br/>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge"></input>
</noscript>
4. for III Spring Security configuration Part A)Full XML config and B)Spring Security namespace config
I cant able to identify in which file i need to do this changes.Please let us know if i am doing any thing wrong
Thanks
This forum is in readonly mode and serves as an archive of old information. All posting, registration and commenting abilities have been turned off. To get help, the Broadleaf team reguarly monitors the broadleaf-commerce tag on Stack Overflow so please ask your questions there.