title: Validate ReCaptcha inside FOSUser login form
body: <p>I am using <code>FosUserBundle</code> and <code>EWZRecaptchaBunde</code>.
  I overrided the login form to add the recaptcha field. Everything is working.</p>
  
  <p>The problem is that the login form validation do not consider the reCaptcha field and if the user enter a correct login and password he will be logged.</p>
  
  <p>I have made a sort of <strong><em>pre login</em></strong> event that should test if the captcha is valid or not but my <strong><em>pre login</em></strong> is a <code>listener</code> that extends <code>UsernamePasswordFormAuthenticationListener</code> and I really don't know how to get the captcha value.</p>
  
  <p>This is the <code>attemptAuthentication</code> method that override the other one, in my <strong><em>pre login</em></strong> listener</p>
  
  <pre><code>protected function attemptAuthentication(Request $request)
  {
      // ...
  
      // I only have added this (return null everytime)
      $captcha = $request-&gt;get($this-&gt;options['recaptcha'], null, true);
  
      if ($captcha &amp;&amp; true !== $captcha) {
          throw new BadCredentialsException('Invalid captcha.');
      }
  
      // ...
  }
  </code></pre>
  
  <p>In the <code>UsernamePasswordFormAuthenticationListener</code> they use something like this <code>$username = $request-&gt;get($this-&gt;options['username'], null, true);</code> to get <code>username</code> and <code>password</code> value. This get the values from <code>input</code> who have <code>_username</code> or <code>_password</code> names (this are defined in the listener constructor).</p>
  
  <p>I tried with the same method as the other field to find the captcha value but the captcha field is a <code>div</code> with an <code>iframe</code> inside, so I get <code>null</code> everytime because it doesn't find anything.</p>
  
  <p>How can I get the value returned by this captcha (true or false, I'm using the new reCaptcha) ?
  I really don't know how should I do to find this value and if this possible of course.</p>
  
  <p>It is maybe not the good method to do to allow captcha validation in login form.</p>
  
  <p>Thanks for helping me.</p>