Currently there is no support for captcha validation in amp-form. You can use the no js version of recaptcha but this is a bad user experience on mobile and defeats the purpose of amp. A component or an extension for amp-form would be great to be able to use the js version of Google's recaptcha validation component.
/to @mkhatib
Not only ReCAPTCHA, but others like Securimage or SolveMedia too.
What are we pending here for? Thanks
Closing as dup of #2273. (where some activity is starting to happen)
Hi @aghassemi
This IS #6150. What is the other one?
Rgds
ok, I guess it has tobe #2273
Sorry @weeblr yes, #2273.
I would argue that #2273 is way too narrow in scope, and the wording of this issue is better. There are other forms of CAPTCHA other than reCAPTCHA, and AMP should be able to support other CAPTCHA images and methods other than reCAPTCHA, I should for example be able to pull an image url and hash dynamically after pageload without using an iFrame
I have question can I run reCapture in amp-iframe?
@taleksey yes, but you'd have to put the whole form inside the iframe as there would be no way for the results of the captcha validation to bubble out of the iframe to the source document
@nickmoline
I agree that it's ideal to support a generic CAPTCHA component. reCAPTCHA is in wide use and also has a different API than the one you mentioned here, so they definitely have to be treated as two different FRs and not one as a subset of the other.
@alanorozco I would agree, unless you go with a method like amp-analytics where you can define a configuration on a per provider
@nickmoline
Can you advise to run reCAPTCHA without amp-iframe? I mean to use another amp tags. I found only one variant to use amp-iframe
@taleksey
For now, the only way you can insert a reCAPTCHA widget is by embedding it in an external form using amp-iframe.
@taleksey as @alanorozco said, it is impossible to use reCAPTCHA on an amp page without embedding the entire form in an amp-iframe, the reason for this is that reCAPTCHA requires external javascript, and it is external javascript that alters the layout of the page after load, this is 2 strikes against the core rules of AMP (no external javascript, and no altering of the page layout after render)
Until a combination of the recaptcha team and the amp team implement some sort of amp component that handles the recaptcha javascript in an amp compatible way, and pre-defines the size of the recaptcha component before hand.
The sizing bit wouldn't be too hard to pre-define in the recaptcha amp component as recaptcha components are pretty much always the same size, so it just requires you to do the pre-defining of it. As @alanorozco commented in #2273 however, it is the javascript that is the problem, in particular the way recaptcha's own iframe renders, so they are unable to implement this yet, but hope to soon.
Hello,
Sorry to reply on an old issue, but in case anyone gets here from a search engine, just want to say this was implemented in #2273 .
See my comment here for getting started: https://github.com/ampproject/amphtml/issues/2273#issuecomment-485953806
Thanks! 馃槃
Most helpful comment
@taleksey yes, but you'd have to put the whole form inside the iframe as there would be no way for the results of the captcha validation to bubble out of the iframe to the source document