amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Allow password (and other) input type in amp-form

Open brozef opened this issue 9 years ago • 8 comments

What's the issue?

amp-form does not currently allow type="password" for input fields. Preventing any sort of secure text field entry for forms.

This is a fairly common feature of forms and shouldn't effect performance at all. There has never been an official response as to why it was disallowed in the first place as seen in https://github.com/ampproject/amphtml/issues/3348

It would be good to see an open discussion on revising the validation rules.

brozef avatar Aug 14 '17 04:08 brozef

I think type=button also allow in input elements.

techhtml avatar Aug 14 '17 06:08 techhtml

/to @cvializ @ericlindley-g

aghassemi avatar Aug 14 '17 17:08 aghassemi

Login flows were a non-goal of the original amp-form implementation. Theoretically there is no reason why we cannot allow password fields in an amp form, but it will take careful security review and possibly some restrictions around which kinds of action URLs are allowed to receive password data.

cvializ avatar Aug 14 '17 18:08 cvializ

Other input types that would be valuable include type="tel", type="number", type="email", etc. These activate different (more appropriate) keyboards on mobile phones, which is often a better user experience. (see Mobile Input Types for ref.)

One specific use case would be a Quantity field in ecommerce. Typically we'd set the input type to input="tel" to activate a number keypad. However, with the current type="text" input restriction, an AMP ecommerce user would tap the Quantity field, which activates an alpha keyboard, then the user has to toggle over to the numbers and symbols keyboard before typing in an updated quantity using the tiny numbers across the top of the numbers and symbols keyboard. Not the best. ☹️

joshcp avatar Sep 21 '17 19:09 joshcp

@joshcp Those should be whitelisted already. If they aren't that should be changed.

Password is a different deal. It won't generally work well in AMP (because of autofill being an origin property) and we need to at least consider phishing risk.

cramforce avatar Oct 04 '17 20:10 cramforce

Clarifying: This is implemented as a blacklist https://github.com/ampproject/amphtml/blob/master/validator/validator-main.protoascii#L2886

@joshcp So all those are allowed.

cramforce avatar Oct 04 '17 20:10 cramforce

@cramforce Will the password input be implemented in the future? We are currently (mis)using the input type text for password for our freemium model, e.g. https://www.shz.de/sport/fussball/kopf-hoch-dino-so-wurschtelt-sich-der-hsv-in-die-relegation-id19250156-amp.html

mario-lorenzen avatar Mar 05 '18 15:03 mario-lorenzen

@mario-lorenzen I'd say: Yes, it will be. Just subject to prioritization of the work.

cramforce avatar Mar 05 '18 16:03 cramforce